Search code examples
jquerysvginkscape

select an element using jquery attribute selector when attribute name is like "attr:attr"


For example, I have an svg path <path ... d="m 100.03365,51.648383 28.346,0 0,-28.346 -28.346,0 0,28.346" inkscape:label="figure_01"></path> All I want is to select him using attribute selector, like $('path[inkscape:label*="figure"]') which is doesn't work (and as I understand, it shouldn't because ":" is reserved for something more awesome). Is there a way to bypass this without editing an svg itself?


Solution

  • Try escaping the : symbol?

    $('path[inkscape\\:label*="figure"]')