Im getting
but the source code is
but the insector shows
Do the custom tag attributes turn to all lowercase?
Im getting
but the source code is
but the insector shows
You’re getting the error because there is a problem with your HTML:
<button class="btn btn-outline-light btn-sm" openRegisterModal">
That trailing quote after openRegisterModal"
makes the attribute malformed. As a result, the browser ignores it, and it doesn’t appear in the DOM at all, so any selector fails.
Fix it like this:
<button class="btn btn-outline-light btn-sm" openRegisterModal>
or:
<button class="btn btn-outline-light btn-sm" openregistermodal="true">
While modern browsers will lowercase attribute names when parsing HTML (you can see this in the DOM inspector), selector matching is actually case-sensitive per the spec—so potentially [openRegisterModal]
may fail where [openregistermodal]
would succeed: https://html.spec.whatwg.org/multipage/semantics-other.html#selectors