Reputation: 21068
Is it valid to use onload function with div element.
Upvotes: 0
Views: 822
Reputation: 25349
According to the HTML 4.01 specification:
[The onload] attribute may be used with BODY and FRAMESET elements.
The short answer to your question, then, is 'no' (at least if you want to constrain yourself to standard behavior).
Upvotes: 3
Reputation: 62894
Not that I'm aware of -- such behavior would likely be fairly hard to define.
Just do whatever you want to do to the div ondomready (or whatever event your favorite javascript utility library provides).
Upvotes: 1