Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

queryselector with ul and not selecting particular li with id

JS-
document.querySelectorAll('#list li:not(#disabled)')

HTML - 
<ul id="list">
<li>OFF</li>
<li>OFF</li>
<li>OFF</li>
<li id="disabled">OFF</li>
<li>OFF</li>
<li>OFF</li>
<li id="disabled">OFF</li>
<li>OFF</li>
</ul>
<button type="button" id="button">Click Me</button>
 
PREVIOUS NEXT
Tagged: #queryselector #ul #selecting #li #id
ADD COMMENT
Topic
Name
7+8 =