属性不能由jquery属性选择器选择 [英] attributes not selectable by jquery attribute selector
问题描述
我自动生成选择器和ive遇到一个问题。一些属性选择器不工作。例如,在此网页上,以下选择器无法按预期工作:
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]");
我也注意到我无法选择< form>使用action属性的值。
I also noticed that I cant select a <form> using the value of the action attribute.
问题:在jQuery选择器中无法使用属性的完整列表。
Question: Is there a full list somewhere of attributes that do not work in jquery selectors.
不是问题:我不是问如何使用jquery函数来选择带有这些属性的元素。
Not the question: I am not asking how to select elements with those attributes using jquery functions.
谢谢。
推荐答案
$("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.
这篇关于属性不能由jquery属性选择器选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!