Borgar.net

— Jump to the navigation index

Tagged: dom

Node members or Node attributes

Having given it a bit of thought I think that this problem stems from a slight confusion as to how DOM nodes’ attributes work.
You would expect javascript code to execute when you apply it to an attribute:
someNode.onclick = “alert(‘foo’);”;
And you expect this to work because this is exactly what you do in your HTML. And [...]

Published: 29. maí 2008.