I want to match all h1's on the document except from a div containing other h1's, currently i can do querySelectorAll('h1:not(.demo)) to get all h1's with except h1's with demo class.
But how can i do querySelectorAll('h1:not(div#demo)) or similar thing?
Below is a sample html
<body>
<div><h1>First</h1> <h1>Second</h1></div>
<div id="demo"><h1 class="demo">Third</h1></div>
<div><h1>Fourth</h1></div>
<body>