<body>
<input type=button onclick="adddesc();" value=" button a ">
<div id=desc style="width:50"></div>
<script>
function adddesc(){
      var maildesc="<input type='button' name='address' value='AlertMsg' onclick='alertmsg()'>";
       document.all.desc.innerHTML=maildesc;
       document.all.desc.style.display='block';
       
}
function alertmsg(){
    alert("this is  button B");
}
</script>
</body>