Y
yawnmoth
Say I had <select id="something" name="something"
onchange="demo(this.value)"> but didn't want to define the onchange
event handler in the select tag, itself. ie. I wanted to attach it,
latter, by doing something like...
document.getElementById('something').attachEvent('onchange',demo);
or this:
document.getElementById('something').onchange = demo;
How would I go about passing parameters to demo as I do in the select
tag? Is there a way I could reference this.value in demo without
having to pass it as a parameter to demo?
onchange="demo(this.value)"> but didn't want to define the onchange
event handler in the select tag, itself. ie. I wanted to attach it,
latter, by doing something like...
document.getElementById('something').attachEvent('onchange',demo);
or this:
document.getElementById('something').onchange = demo;
How would I go about passing parameters to demo as I do in the select
tag? Is there a way I could reference this.value in demo without
having to pass it as a parameter to demo?