I have some HTML resembling this:
<input name="arr[something completely random][something else I can't rely on][initial]" />
<!-- ... -->
<input name="arr[dadedadeda][blahblahblah][initial]" />
And my JavaScript document.querySelectorAll('[name~="initial"]')
returns []
(empty). Why? Are multidimensional arrays in names dealt with differently? Is there something I'm missing?
I just tried document.querySelectorAll('[name$="[initial]"]')
, the ends with
selector (attr$="endStr"
), and this returns what I need, but I still need to know why the attribute contains
selector (attr~="inStr"
) is failing to work