2014-10-01 90 views
-1

我需要在屬性marker-end中繪製所繪製的SVG中的所有path元素。查找具有屬性的所有元素

我嘗試:

$('path').attr("marker-end") // Returns undefined 
$('path').prop("marker-end") // Returns undefined 

更新

另外path元件not具有給定的屬性。

更新2

確定,得到了$('path:not([marker-end])')

+0

[jQuery文檔](HTTP: //api.jquery.com)... docs [選擇器](http://api.jquery。 com/category/selectors /)... docs [for attribute selectors](http://api.jquery.com/category/selectors/attribute-selectors/)... docs [for filters](http:// api .jquery.com/category/selectors/basic-filter-selectors /)(比如':not()') – 2014-10-01 14:03:57

回答

2

嘗試以下:

$('path[marker-end]') 
$('path[marker-end=value]") 

隨着換句話說,語法是:

$("path[ATTRIBUTE_NAME]") 
相關問題