javascript .not(cssSelector)
javascript : DomElementList.not( cssSelector ) Target: Applicable with any DOM element or elements List. getElementById getElementsByTagName getElementsByClassName getElementsByName querySelector querySelectorAll select etc. Description : it return DOMNodeList of element/elements List with filter of selector that are not matched. Note: use for removing elements from list that are matched with selector. Syntax: DOMElement.not( selector ) DOMNodeList.not( selector ) HTMLCollection.not( selector ) Usase: document.getElementById('firstDiv').not( 'div' ) if element having id firstDiv is not div then the DOMNodeList that returned has firstDiv element otherwise the list will empty. document.getElementsByTagName('div').not( '.firstDiv' ) the getElementsByTagName selects all div and not() method removes all dives that has class name firstDiv and return DOMNodeList of all dives having not class firstDiv. document.getElementsByClassName('FirstDiv').not( ...