How to appenchild one time in form validation?


try to add appendchild one time when I click submit it show many time

if(input_name.value =="" ||input_email.value =="" || input_password.value =="")
{
    var tag = document.createElement("p");
    var text = document.createTextNode("all input are reqired");
    tag.appendChild(text);
    var element = document.getElementById("new");
    element.appendChild(tag);
}



Source link

Latest articles

Related articles

Leave a reply

Please enter your comment!
Please enter your name here