if you want to add a new button, try<script language="javascript">
function addBtn()
{
  var btn = document.createElement("INPUT");
  btn.type="button";
  btn.value = "new";
  btn.onclick= function(){alert("hello")};
  document.frmtest.appendChild(btn);
}
</script>
<form name="frmtest">
<input type="button" value="add another button" onclick="addBtn()">
</form>