I am creating HTML DOM elements using Javascript (yes, I know it's nasty).
I can get the select element created but I cannot add an onchange property.
Example:
var sel = document.createElement('select');
sel.id = 'someID';
sel.title = 'Some title';
sel.style.fontWeight = 'bold';
sel.size = 1;
Once I have added the options and have done a
document.getElementById('someOtherID').appendChild(sel);
I get my select element.
What I want to do is, at A above, add:
sel.onChange = 'someJavascriptFunction()';
but it doesn't like it.
Should I be thinking outside of the square? Which one?