Posts

Showing posts with the label filterNot

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( ...

javascript : .filterNot(cssSelector)

  javascript : DomElementList.filterNot( 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.filterNot( selector ) DOMNodeList.filterNot( selector ) HTMLCollection.filterNot( selector ) Usase: document.getElementById('firstDiv').filterNot( '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').filterNot( '.firstDiv' ) the getElementsByTagName selects all div and filterNot() method removes all dives that has class name firstDiv and return DOMNodeList of all dives having not class firstDiv. document.getElem...

javascript : .filter(cssSelector)

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

javascript : .find(cssSelector)

  javascript : .find( cssSelector ) Target: Applicable with any DOM element or elements List. getElementById getElementsByTagName getElementsByClassName getElementsByName querySelector querySelectorAll select etc. Description : it search selector in the element/elements list children and return all children DOMNodeList that are matched with selector passed. Syntax: DOMElement.find( selector ) DOMNodeList.find( selector ) HTMLCollection.find( selector ) Usase: document.getElementById('firstDiv').find( 'input' ) it search input elements in firstDiv and return DOMNodeList of all input elements inside firstDiv. document.getElementsByTagName('div').find( 'input' ) the getElementsByTagName selects all div and find() method seaches input elements in all dives and return DOMNodeList of input elements. document.getElementsByClassName('FirstDiv').find( 'input' ) the getElementsByClassName selects all elements having class FirstDiv and find() method...

javascript : .visible()

  javascript : .visible() Target: Applicable with any DOM elements List. getElementById getElementsByTagName getElementsByClassName getElementsByName querySelector querySelectorAll select etc. Description : return DOMNodeList that are visible in selector. Syntax: DOMElement.visible() DOMNodeList.visible() HTMLCollection.visible() Usase: document.getElementById('firstDiv').visible() if the div having id firstDiv is visible then return DOMNodeList having firstDiv document.getElementsByTagName('div').visible() the getElementsByTagName selects all div and visible() method returns only all divs that are visible as DOMNodeList. document.getElementsByClassName('FirstDiv').visible() the getElementsByClassName selects all elements having class FirstDiv and visible() method returns elements that are visible in list as DOMNodeList. document.getElementsByName('FirstDiv').visible() the getElementsByName selects all elements having name attribute "FirstDiv" ...

javascript : .select(cssSelector)

  javascript : .select( cssSelector ) Target: Applicable with any DOM element or elements List. document getElementById getElementsByTagName getElementsByClassName getElementsByName querySelector querySelectorAll select find filter filterNot not visible nextAll prevAll next prev closest Description : It search selector element in the document/element/elements list itself or children and return all DOMNodeList that are matched with selector passed. Syntax: Document.select( selector ) DOMElement.select( selector ) DOMNodeList.select( selector ) HTMLCollection.select( selector ) Note : selector may be any css selector string or DomElement Usase: document.select('#firstDiv  input' ) it search input elements in firstDiv and return DOMNodeList of all input elements inside firstDiv. document.select(' .divExample ').select(' li ).select(' span ')  It find ".divExample" in document and then find "li" in result list and then find "span" i...