H
HugeBob
Hi All,
I'm creating textareas via the DOM and I'm trying to add the onchange
event to them. Here's my code:
mytextarea = document.createElement("textarea");
mytextarea.onchange = mymethod;
mytextarea.name = "textarea1";
mytextarea.value = "";
..
..
..
In another script file, I have the mymethod() function defined like
this:
function mymethod()
{
..
..
..
}
I tried various incarnations of setting the onchange event:
mytextarea.onchange = "mymethod()"; and onchange = "mymethod";. None
of which works. What's the secret to dynamically defining the
onchange event?
I'm creating textareas via the DOM and I'm trying to add the onchange
event to them. Here's my code:
mytextarea = document.createElement("textarea");
mytextarea.onchange = mymethod;
mytextarea.name = "textarea1";
mytextarea.value = "";
..
..
..
In another script file, I have the mymethod() function defined like
this:
function mymethod()
{
..
..
..
}
I tried various incarnations of setting the onchange event:
mytextarea.onchange = "mymethod()"; and onchange = "mymethod";. None
of which works. What's the secret to dynamically defining the
onchange event?