jQuery selector by xlink

后端 未结 5 1731
执笔经年
执笔经年 2021-01-27 11:19
$(\'a[xlink\\\\:href=#coastline]\').attr(\'class\',\'grey\');
$(\'a[xlink\\\\:href=#onshore]\').attr(\'class\',\'blue-light\');

This is what I currentl

5条回答
  •  情歌与酒
    2021-01-27 11:43

    [*|href] will match both html href and svg xlink:href, then use :not([href]) to exclude html href.

    //document.querySelectorAll('[*|href]:not([href])');
    $('[*|href]:not([href])');
    

    tested in chrome

提交回复
热议问题