Dynamic Creating of a button
Posted on 2002-03-12
I am trying to create a button dynamically using vbscript on an HTML page. However I cannot seem to capture the onclick event. The button is displayed correctly, but clicking it has no effect.
The code I am using to create the button is as follows:
Set oField = document.createElement("INPUT")
oField.Type = "BUTTON"
oField.Name = "cmd1"
oField.Value = "Remove"
oDoc.insertAdjacentElement "afterBegin", oField
I have also tried using oField.onclick=GetRef ("msgbox(1)"), but it makes no difference
I am using IE 5.5 BTW
Thanks in advance.