Answers for "check if an element exist"

22

jquery check if element exists

// Check if an element currently exists
if ($('#element').length) {

}
Posted by: Guest on June-05-2020
1

check if the element exists in javascript

var myEle = document.getElementById("myElement");
    if(myEle){
        var myEleValue= myEle.value;
    }
Posted by: Guest on February-02-2021

Code answers related to "check if an element exist"

Code answers related to "Javascript"

Browse Popular Code Answers by Language