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

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

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


            


        
5条回答
  •  春和景丽
    2020-12-24 12:20

    the syntax for matching by attribute is:

    $("div[customattr=bla]") matches div customattr="bla"

    $("[customattr]") matches all tags with the attribute "customattr"

    with namespace attributes like 'custom:attr' its not working

    Here you can find a good overview.

提交回复
热议问题