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>
12<p id="demo" onclick="myfun();"> click me to create button </p>
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>