Javascript examples for DOM HTML Element:Input Button
Create button where a mouse was clicked
<html> <head></head> <body> <script type="text/javascript"> counter = 1;/*from w ww . j a v a 2 s .co m*/ document.onclick = function(e) { var button = document.createElement('button'); button.style.position = 'fixed'; button.style.left = e.pageX + 'px'; button.style.top = e.pageY + 'px'; button.innerHTML = counter; counter++; document.body.appendChild(button); setTimeout(function() { document.body.removeChild(button); }, 1000); }; </script> </body> </html>