Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jQuery equivalent for find with contains #201

Open
hipertracker opened this issue Oct 16, 2017 · 1 comment
Open

jQuery equivalent for find with contains #201

hipertracker opened this issue Oct 16, 2017 · 1 comment

Comments

@hipertracker
Copy link

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

jQuery('#menu-sidebar-menu li a:contains("Hello World!")')
@LeaVerou
Copy link
Owner

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants