Posts

Showing posts with the label visible

javascript domElement .is(cssSelector|":visible"|domElement)

  javascript domElement .is( cssSelector|":visible"|domElement ) Target: Applicable with any DOM element. getElementById getElementsByTagName getElementsByClassName getElementsByName querySelector querySelectorAll Description : return  true  if target element or first element of list is matched with selector other wise  false  . selector :  any css selector string ":visible" :  string for check is visible. Same as isVisible() method DomElement :  matched with element if both are same then return true other wise false. Syntax: DOMElement.is( selector ) DOMNodeList.is( selector ) HTMLCollection.is( selector ) Usase: document.getElementById('firstDiv').is( "div" ) it return true if firstDiv element is div other wise false document.getElementsByTagName('div').is( ".FirstDiv" ) the getElementsByTagName selects all div but is() method check for only first div and if it has class Firstdiv then return true else false. document.getElements...

javascript : domElement .isVisible()

  javascript : domElement .isVisible() Target: Applicable with any DOM element. getElementById getElementsByTagName getElementsByClassName getElementsByName querySelector querySelectorAll Description : return  true  if target element or first element of list is visible other wise  false . Syntax: DOMElement.isVisible() DOMNodeList.isVisible() HTMLCollection.isVisible() Usase: document.getElementById('firstDiv').isVisible() it return true if firstDiv element is visible other wise false document.getElementsByTagName('div').isVisible() the getElementsByTagName selects all div but isVisible() method check for only first div and if it is visible then return true else false. document.getElementsByClassName('FirstDiv').isVisible() the getElementsByClassName selects all div having class "FirstDiv" but isVisible() method consider only first element and return true if it is visible other wise false. document.getElementsByName('FirstDiv').isVisible() the ...

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