:hidden and :visible selectors are not available
See original GitHub issueThe :hidden
and :visible
selectors are not available.
http://api.jquery.com/hidden-selector/ http://api.jquery.com/visible-selector/
Test case:
var cheerio = require('cheerio');
var $ = cheerio.load('<h1 style="display:none">Test</h1>');
console.log($("h1:hidden").length);
Error:
SyntaxError: unmatched pseudo-class :hidden
Issue Analytics
- State:
- Created 10 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Difference between :hidden and :not(:visible) in jQuery
The :hidden selector is the opposite of the :visible selector. So, every element selected by :hidden isn't selected by :visible and vice versa....
Read more >:visible Selector | jQuery API Documentation
So, every element selected by :visible isn't selected by :hidden and vice versa. All option elements are considered hidden, regardless of their selected...
Read more >jQuery :visible Selector - W3Schools
The :visible selector selects every element that is currently visible. Visible elements are elements that are not: Set to display:none; Form elements with...
Read more >How to select all visible or hidden elements in a HTML page ...
:visible Selector The visible Selector is used to select all the elements that are currently visible in the document. Syntax: $(":visible"). : ...
Read more >How to Check an Element is Visible or not Using jQuery
This selector will also select the elements with visibility: hidden; or opacity: 0; , because they preserve space in the layout even they...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I needed to remove :hidden elements, and so I made this piece of code which checks
.css('display')
value:IMHO this would do more harm than good - a partial implementation would have people expecting the selector to work properly, which it never will.