imacrayon / alpine-ajax

An Alpine.js plugin for building server-powered frontends.
https://alpine-ajax.js.org
MIT License
558 stars 11 forks source link

Does x-target require a form? #81

Closed eydun closed 2 months ago

eydun commented 2 months ago

X-target is working for me when using forms.

But if I use a simple html-link with href, then it does not work for me.

<a href="/contacts" x-target="contacts">Open</a>

I guess that is intended behavior?

imacrayon commented 2 months ago

It should work. Make sure you have an x-data or x-init on the link or on a parent element too.

eydun commented 2 months ago

Thanks, it was x-init that was missing!