Answers for "appendchild element once if element present in js"

0

appendchild element once if element present 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>
<p id="demo" onclick="myfun();"> click me to create button </p>
Posted by: Guest on January-08-2021
0

appendchild on specific position

parentElement.insertBefore(newElement, parentElement.children[2]);
Posted by: Guest on October-04-2020
0

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>
Posted by: Guest on January-08-2021

Code answers related to "appendchild element once if element present in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language