Take the 2-minute tour ×  i have a javascript that i need to
load at the body, but since im trying to build something
flexible i really want it to function on a onLoad on a divtag.
But thats not going to happen as i understand it as onLoad does
not work on a divtag.  is there another way i can load/start a
function within a divtag? or when i include the .js file?
share|improve this question add comment  2 Answers  up vote 1
down vote accepted  you can embed script snippets which execute
when they are loaded. This example is from jquery...  <span
class="myclass otherclass">span class="myClass"</span>
<script>$(".myclass.otherclass").css("border","13px solid
red");</script>  Maybe you need to make your question more
clear?  share|improve this answer That's a reasonable idea.
You'd have to run it after the element it references has loaded
in the DOM though. –  Diodeus May 13 '10 at 0:51 i really wanted
to be independent of another lib but jquery solves my problem.
–  Jason94 May 13 '10 at 1:00 While many would