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" })
Another way to do this would be to use jQuery's attribute selector:
$("br[style$='display: none;']")
Using filter.
$("br").filter(function () {
return $(this).css("display") == "none";
});
How about something like this:
$(document).ready(function() {
$("div:hidden").each(function() {
if ($(this).css("display") == "none") {
// do something
}
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With