I have use the example of sizzle and there I got window.onload in the last of the code.
What does this means.
My code is like this:
var init = function () {
var trail = Sizzle;
var foo = trail('.foo');
foo[0].onmouseover = function () {
this.style.backgroundColor = (this.style.backgroundColor.indexOf('blue') === 0) ? 'yellow' : 'blue';
};
foo[1].onmouseover = function () {
this.style.backgroundColor = (this.style.backgroundColor.indexOf('red') === 0) ? 'yellow' : 'red';
jQuery(foo[1]).after("<b>Hello</b>");
}
foo[2].onmouseover = function () {
this.style.backgroundColor = (this.style.backgroundColor.indexOf('green') === 0) ? 'yellow' : 'green';
jQuery(foo[3]).toggle("slow");
jQuery('b').remove();
}
};
window.onload = init;
What does this mean?