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.