attributes not selectable by jquery attribute sele

2019-08-06 20:38发布

问题:

This question already has an answer here:

  • attributes not found by jquery attribute selector 2 answers

I am auto generating selectors and ive ran into a problem. some attribute selectors dont work. for example, on this page the following selector does not work as expected:

$("img[src=/p/aost/logo?logo_id=1238551994]"); 

I also noticed that I cant select a <form> using the value of the action attribute.

Question: Is there a full list somewhere of attributes that do not work in jquery selectors.

Not the question: I am not asking how to select elements with those attributes using jquery functions.

Thank you.

回答1:

$("img[src='/p/aost/logo?logo_id=1238551994']");

Quote the string when you have non-alphanumeric characters, I think you have the same problem in the action url.