How to select input with array name attribute in jQuery above version 1.4.x
I started to browse small script that was attached to the page and found the culprit. Situation I encountered is shown on image below.
As we can see here, selecting all nodes that contain attribute name=test is not accepted in jQuery 1.5.x and above. And that’s the way it should be according to jQuery API. Lower version were too tolerant about this. Image below shows the right way to select these nodes.
First method using $(‘[name=”test”]’) (also replacable by $(“[name=’test’]”)) is done “by the book” just as jQuery API shows. The second one - $(“[name=”test”]”) - can be used when you really want to stick to double quotes all the time - quotes surrounding test are escaped here. I recommend used the first selector, because the second seems to be like not enough badass for a real coder.