appendchild element once if element presense in js

Solutions on MaxInterview for appendchild element once if element presense in js by the best coders in the world

showing results for - "appendchild element once if element presense in js"
Shayna
08 Mar 2016
1 <script>
2       var button = false;
3        function  myfun(){
4            if ( button === false){
5                var b1 = document.createElement("BUTTON");
6                b1.innerHTML = "Click Me";
7                document.body.appendChild(b1); 
8                return button = true;  
9            }
10      }
11    </script>