How do I select an element based on its css?
I need to select a br with inline style display:none. This is not the same thing as br:hidden, because that selects elements that are hidden in other ways, and I don't want that.
Thanks.
How do I select an element based on its css?
I need to select a br with inline style display:none. This is not the same thing as br:hidden, because that selects elements that are hidden in other ways, and I don't want that.
Thanks.
You could try:
$("br").filter(function() { return $(this).css("display") == "none" })
Using filter.
$("br").filter(function () {
return $(this).attr("display") == "none";
});
Use jQuery.map:
var brs = $('br');
jQuery.map(brs, function(elem, i){
if(elem.css('display') == 'none')
return elem;
return null;
});
How about something like this:
$(document).ready(function() { $("div:hidden").each(function() { // do something if the following matches if ($(this).css("display") == "none") { } }); });