Monthly Archives: July 2014
How to select all anchors with display block jquery
How to select all anchors with display block jquery Very often or not, you need to select all the elements from within the DOM, that have their display property set to “block”. Solution
1 2 3 |
$('a').filter(function (index) { return $(this).css("display") === "block"; }) |
Filter function from jQuery to the rescue. Description: Reduce the set of matched elements to those that match the selector or pass