Posts

Showing posts from August, 2020

javascript .prevAll()

  javascript .prevAll() Target: Applicable with any DOM element. getElementById getElementsByTagName getElementsByClassName getElementsByName querySelector querySelectorAll select etc. Description : return DOMNodeList of prev all sibling elements of selected element. Note: if selector is DOM Elements List then first node element's previous all sibling nodes return as DOMNodeList. Syntax: DOMElement.prevAll() DOMNodeList.prevAll() HTMLCollection.prevAll() Usase: document.getElementById('firstDiv').prevAll() it search element having id firstDive and return all elements previous to it in same parent as DOMNodeList. document.getElementsByTagName('div').prevAll() the getElementsByTagName selects all div and prevAll() method return first div's previous all sibling nodes as DOMNodeList document.getElementsByClassName('FirstDiv').prevAll() the getElementsByClassName selects all div having class "FirstDiv" and prevAll() method return first element's...

javascript : .nextAll()

  javascript : .nextAll() Target: Applicable with any DOM element. getElementById getElementsByTagName getElementsByClassName getElementsByName querySelector querySelectorAll select etc. Description : return DOMNodeList of next all sibling elements of selected element. Note: if selector is DOM Elements List then first node element's next all sibling nodes return as DOMNodeList. Syntax: DOMElement.nextAll() DOMNodeList.nextAll() HTMLCollection.nextAll() Usase: document.getElementById('firstDiv').nextAll() it search element having id firstDive and return all elements next to it in same parent as DOMNodeList. document.getElementsByTagName('div').nextAll() the getElementsByTagName selects all div and nextAll() method return first div's next all sibling nodes as DOMNodeList document.getElementsByClassName('FirstDiv').nextAll() the getElementsByClassName selects all div having class "FirstDiv" and nextAll() method return first element's next all ...

javascript : .prev()

  javascript : domElement .prev() Target: Applicable with any DOM element. getElementById getElementsByTagName getElementsByClassName getElementsByName querySelector querySelectorAll Description : return previous sibling element of selected element other wise empty nodeList. Note: if selector is DOM Elements List then first node element's previous sibling node return. Syntax: DOMElement.prev() DOMNodeList.prev() HTMLCollection.prev() Usase: document.getElementById('firstDiv').prev() if firstDive element's previous sibling node exists return it. document.getElementsByTagName('div').prev() the getElementsByTagName selects all div and prev() method return previous sibling node if exists document.getElementsByClassName('FirstDiv').prev() the getElementsByClassName selects all div having class "FirstDiv" and prev() method return first element's previous sibling node if exists. document.getElementsByName('FirstDiv').prev() the getElements...

javascript : .next()

javascript : domElement .next() Target: Applicable with any DOM element. getElementById getElementsByTagName getElementsByClassName getElementsByName querySelector querySelectorAll select etc. Description : return next sibling element of selected element other wise empty nodesList. Note: if selector is DOM Elements List then first node element's next sibling node return. Syntax: DOMElement.next() DOMNodeList.next() HTMLCollection.next() Usase: document.getElementById('firstDiv').next() if firstDive element's next sibling node exists return it. document.getElementsByTagName('div').next() the getElementsByTagName selects all div and next() method return next sibling node if exists document.getElementsByClassName('FirstDiv').next() the getElementsByClassName selects all div having class "FirstDiv" and next() method return first element's next sibling node if exists. document.getElementsByName('FirstDiv').next() the getElementsByName se...

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

javascript : String.mid

  javascript : String .mid( n, m ) Target: Applicable with  String  Data Type. Description : return m number of charector from string starts from n. Syntax: String .mid( n, m ) Usase: "abcdefghijklmnopqrstuvwxyz".mid(7,5) It return string "hijkl" Download MYJS.js MyJs is a collection of java script extension methods that enhances the JavaScript objects, class object, DOM element, domElementsCollections, Date, String, Number and other data type.  Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.

javascript : String.right

  javascript : String .right( n ) Target: Applicable with  String  Data Type. Description : return last n number of charector from string. Syntax: String .right( n ) Usase: "abcdefghijklmnopqrstuvwxyz".right(7) It return string "tuvwxyz" Download MYJS.js MyJs is a collection of java script extension methods that enhances the JavaScript objects, class object, DOM element, domElementsCollections, Date, String, Number and other data type.  Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.

javascript : String.left

  javascript : String .left( n ) Target: Applicable with  String  Data Type. Description : return first n number of charector from string. Syntax: String .left( n ) Usase: "abcdefghijklmnopqrstuvwxyz".left(7) It return string "abcdefg" Download MYJS.js Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.

javascript : String.reverse()

  javascript : String .reverse() Target: Applicable with  String  Data Type. Description : Reverses the string letter by letter right to left. Syntax: String .reverse() Usase: " hello     how     are     you ? ".reverse() It return string " ? uoy     era     woh     olleh " "hello-how-are-you-?".reverse() It return string "?-uoy-era-woh-olleh" Download MYJS.js MyJs is a collection of java script extension methods that enhances the JavaScript objects, class object, DOM element, domElementsCollections, Date, String, Number and other data type.  Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.

javascript : Number.format(strFormat)

javascript : Number .format( strFormat ) Target: Applicable with  Number  Data Type. Description : format Number to string with given format string. Note: strFormat should to matched with regular Expression "/^([0#,])+([.]){0,1}([0])*$/" other wise return toLocalString(). Syntax: Number .format( strFormat ) Usase: (123456.123456).format("##,##,##0.00")  //Currency It return string "1,23,456.12" (123456.123456).format("00000000000")  //pad zero It return string "00000123456" (123456545).format("00000000000.00")  //pad zero + decimal It return string "00123456545.00" (123456545).format("0.00")  //Fixed Decimal Places It return string "123456545.00" (123456.545).format("0.00")  //floating point round in decimal places It return string "123456.55" Download MYJS.js MyJs is a collection of java script extension methods that enhances the JavaScript objects, class object, DOM element...