umair mohsin

umair mohsin

  • 1.4k
  • 387
  • 65.9k

question about header in javascript

Feb 22 2015 1:21 PM
i want to make a dynamic header control using following method:
 
function myfunction()
{

var btn=document.createElement("input");
btn.value="click me";
btn.type="button";
btn.title="dynamic button";
btn.onclick=function()
{
alert("you click dynamic button");

}
document.body.appendChild(btn);


}
 
 
function is called using button click event.originally this was the method of creating a button.although button is creating but header is not creating using this function. i replaced input by H3.

Answers (1)