Create Button at Run time on button click by Java Script
Source Code :-
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<p> Click the button to make a BUTTON element with text.</p>
<button onclick="myFunction()">
Try it</button>
<script type="text/javascript">
function myFunction() {
var btn = document.createElement("BUTTON");
var btn1 = document.createTextNode("CLICK Here");
btn.appendChild(btn1);
document.body.appendChild(btn);
}
</script>
</body>
</html>
No comments:
Post a Comment