1
Answer

question about header in javascript

umair mohsin

umair mohsin

9y
381
1
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)