Suppose I have a simple XHTML document that uses a custom namespace for attributes:
<html xmlns='...' xmlns:custom='http://www.example.com/ns'> ... <div class='foo' custom:attr='bla'/> ... </html>
How do I match each element that has a certain custom attribute using jQuery? Using
$('div[custom:attr]')
does not work. (Tried with Firefox only, so far.)
jQuery does not support custom namespaces directly, but you can find the divs you are looking for by using filter function.