I've written a JavaScript function which does some stuff to the content of another element. For debugging I ran it from onclick, for example:

 <span onclick="xyz(this)">abc</span>
Once it was working, I wanted to call it when the page finished loading:

 <span onload="xyz(this)">abc<span>
Surprise! It did nothing. The function was never called.

I looked up onload and found that it's supported by <body>, <frame>, <script>, and a few other tags, but not by <span>.

That kind of makes sense to me, but... now what? Content tags like <span> don't seem to have any event that is fired when a page is loaded. How can I get that result?