Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

appendchild element once if element presense in js

 <script>
       var button = false;
        function  myfun(){
            if ( button === false){
                var b1 = document.createElement("BUTTON");
                b1.innerHTML = "Click Me";
                document.body.appendChild(b1); 
                return button = true;  
            }
      }
    </script>
 
PREVIOUS NEXT
Tagged: #appendchild #element #element #presense #js
ADD COMMENT
Topic
Name
3+7 =