PDA

View Full Version : is there an alternative to 'onClick' in JS


moggers1
09-09-2002, 07:11 PM
i need an alternative to the event handler 'onClick'. This works fine in the html document however i want to put a button in the script which looks something like this -

document.write("<input type='button' value='Go' onClick='go()'>")

which doesn't seem to work when i try it. i am fairly new to jscript & any help would be much appreciated. thanks....

ian.

requestcode
09-09-2002, 07:17 PM
In what way is it not working? Are you getting an error when it writes out the line or are you getting an error when you click the button? Maybe it is the function that you are calling that is the problem.