jQuery attribute selectors: How to query for an attribute with a custom namespace

前端 未结 5 1542
一整个雨季
一整个雨季 2020-12-24 11:46

Suppose I have a simple XHTML document that uses a custom namespace for attributes:


            


        
5条回答
  •  旧巷少年郎
    2020-12-24 12:18

    This works in some conditions:

    $("div[custom\\:attr]")

    However, for a more advanced method, see this XML Namespace jQuery plug-in

提交回复
热议问题