Every line of 'javascript check if element exists' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
141 function isVisible(element_id) { 142 var elm = document.getElementById(element_id); 143 144 return elm && elm.style.display != "none"; 145 }
8 function checkInputElement(elementId) { 9 var element = document.getElementById(elementId); 10 return element == null || (element.value || '') !== ''; 11 }
66 checkElementId(element, index: number) { 67 return element.id === `${this.workflow.settings.itemIdPrefix}${index}`; 68 }
20 function doesElementExist(selector: string): boolean { 21 return fixture.debugElement.queryAll(By.css(selector)).length > 0; 22 }
87 function check_validation(element_id) 88 { 89 if(!($(element_id).val())) 90 { 91 $(element_id).parent().parent().parent().addClass("errors"); 92 $(element_id).parent().parent().parent().children('ul').show(); 93 $("#errornote").show(); 94 return true; 95 } 96 else 97 return false; 98 }
10 elementTagExists(tag : string) { 11 return element(by.tagName(tag)).isPresent(); 12 }
218 _selector_exists() { 219 return $(this.chart_selector).length > 0; 220 }
1 function jsCheck(id) 2 { 3 el=document.getElementById(id); 4 el.checked='checked'; 5 }
247 function elementByCssExists(selector, delay = 2000) { 248 return driver.waitForElementByCss(selector, delay) 249 .should.eventually.exist; 250 }
11 async elementExists(selector, frameId = 0) { 12 // console.log(`check for ${selector} in tab ${this.id}, frame ${frameId}`); 13 return browser.tabs.sendMessage(this.id, { 14 type: 'elemExists', 15 selector, 16 }, { 17 frameId, 18 }); 19 }