I have the following situation:
<div id="foo">
<div id="1" style="transform:translate3d(5px,5px,5px);"></div>
<div id="2" style="background-color:black;"></div>
</div>
I want to find the div that does not have the 'transform' property i.e div with 'id = 2'.
I have tried the following, but it only selects the div having transform property, I want the exact opposite.
$('#foo').find('div[style*="transform"]');
$('#foo').find('div:not([style*="transform"])').css('color','red')
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="foo">
<div id="1" style="transform:translate3d(5px,5px,5px);">1</div>
<div id="2" style="background-color:black;">2</div>
</div>
:not()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