bliss icon indicating copy to clipboard operation
bliss copied to clipboard

jQuery equivalent for find with contains

Open hipertracker opened this issue 8 years ago • 1 comments

How to find a DOM node in Bliss which can be found in jQuery as:

jQuery('#menu-sidebar-menu li a:contains("Hello World!")')

hipertracker avatar Oct 16 '17 14:10 hipertracker

You can't do that with a selector, Bliss only supports the same CSS selectors that the browser supports. So you'd have to loop over them, like this:

$$('#menu-sidebar-menu li a').filter(a => a.textContent.indexOf("Hello World!") > -1);

LeaVerou avatar Oct 16 '17 14:10 LeaVerou