I guess it depends. I prefer the simplicity of jQuery which might be easier to understand for someone with little js knowledge:
$('#strTester').html('<span id="mySpan">The cow jumped over the moon</span>');
var mySpan = $('#mySpan');
Remember to include this in your page:
And to check out the documentation:
In this case particularly:
I trust that the jQuery team has performance as a top priority. Using $(document).ready() is more generic than using window.onload because you can use the first more times but the latter only once on a page.