Open wh33t opened 9 months ago
I'm new to htmx, but encountered something like this in another context, which led me to this StackOverflow answer. Since the value of hx-target can be a CSS selector, maybe the period needs to be escaped?
Update: Confirmed this. Escape the period with a backslash in the htmx attribute (such as hx-target
). For example, this works for me:
<button hx-get="/hello" hx-target="#hello\.world">Test</button>
<div id="hello.world">...</div>
Without the escaping backslash, htmx doesn't even make the get request (presumably since it can't find the target element, it doesn't bother to get the response that it will have nothing to do with).
If I'm reading this correctly (and it is the thing to read?): https://www.w3.org/TR/html4/types.html#h-6.2
I can't seem to get HTMX to target an ID if it has a period in it's name.
Is this a bug?