Say you wanted to make an element blue with JS, like this:
<p onload="this.style.color = 'blue'">Boy, I sure do wish I was blue</p>
The above line doesn't work, as this
targets the window object in that context. You could use ID's, but I'd assume there's a better way.
So, like the title says, is there any easy way to target an element with onload within that onload? Note that such a solution would have to work when there are multiple elements with the onload
attribute in the page.