I need an attribute selector to match the first div element with an z-index and a value of 0. tTis is how i tried to get hands on the element,by using the css attribute selector syntax in jquery:
$("div[z-index='0']").first().doSomeJqueryStuff() ....
In my document there is an explicitly set z-index with a value of 0 on a div element, but the selector returns no result. Thanks for help!
You can apply attribute selector to inline style attribute (* means contains):
div[style*="z-index: 0"]
Try
$('div').each(function({
if ($('div').css('z-index') === '0') { // or ... === 0
....
}
}
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