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.create Element("textar ea");
mytextarea.onch ange = mymethod;
mytextarea.name = "textarea1" ;
mytextarea.valu e = "";
..
..
..
In another script file, I have the mymethod() function defined like
this:
function mymethod()
{
..
..
..
}
I tried various incarnations of setting the onchange event:
mytextarea.onch ange = "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.create Element("textar ea");
mytextarea.onch ange = mymethod;
mytextarea.name = "textarea1" ;
mytextarea.valu e = "";
..
..
..
In another script file, I have the mymethod() function defined like
this:
function mymethod()
{
..
..
..
}
I tried various incarnations of setting the onchange event:
mytextarea.onch ange = "mymethod() "; and onchange = "mymethod"; . None
of which works. What's the secret to dynamically defining the
onchange event?
Comment