0
我有以下HTML:如何按属性查找div元素?
<body>
<div id="contentPane">
...
...
<div guidedhelpid="friendsuggestions">
...
</div>
</body>
我需要做一些改变guidedhelpid。例如,$(#theElem).remove()
注意:我可以根据请求使用jQuery。
这样做的最佳方法是什么?
我认为[这](http://stackoverflow.com/questions/9496427/how-to-get-elements-by-attribute-selector-w-可能本机JavaScript的禾雀ryselector)可以帮助你制作你自己的JS函数,而不是jquery。 – woofmeow
[在jQuery中查找具有特定属性值的所有元素]的可能重复(http://stackoverflow.com/questions/4958081/find-all-elements-with-a-certain-attribute-value-in-jquery) –
我建议使用'data- *'属性,以便您的HTML有效。 –