我ALIST的img
標籤都有效,其中一些有屬性style="display:none"
例如:如何檢查圖像是否有屬性?
<img src="#">
<img src="#" style="display: none">
<img src="#">
<img src="#" style="display: none">
<img src="#" style="display: none">
<img src="#">
<img src="#" style="display: none">
如何(使用jQuery或JavaScript),我可以得到它沒有屬性style="display:none"
元素?
UPD:我已經選擇了有一定的來源($("img[src='http://certain-source.jpg']")
),但他們中的一些有串style="display:none"
,現在我必須選擇那些不包括該字符串的圖像。
也許,你還沒有明白我的意思。我不得不選擇img-tags,除了src =「」 閱讀更新的問題 –
我明白了你的意思,而'style =「display:none」'使元素不可見,而jQuery有一個':visible'選擇器,所以你可以用它來選擇可見的元素。 – adeneo