Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
和
input[name="abc"]
但是,如果名称中包含[and之类的内容]怎么办?
[
]
我的输入看起来像:
<input type="text" name="abc[def][5][xyz][]" value="" />
[]如果属性值包含在其中,则无需转义""
[]
""
$('input[name="abc[def][5][xyz][]"]')
演示链接:小提琴
使用转义字符input[name=\[def\]\[5\]\[xyx\]\[\]]。
input[name=\[def\]\[5\]\[xyx\]\[\]]