Reputation: 4004
What do I replace the question marks with if I want the class to be added when the page is loaded?
$("form#signupform input#email").live("????", function() {
$(this).addClass("launchrock");
});
Upvotes: 1
Views: 135
Reputation: 10926
$(window).load(function(){...});
is called when the images have loaded, $(document).ready(function(){...});
will be called as soo as the js/css/dom has been loaded and can execute
read this for more information tho
http://4loc.wordpress.com/2009/04/28/documentready-vs-windowload/
Upvotes: 0
Reputation: 490403
You'd replace more than that.
$(window).load(function() {
$("form#signupform input#email").addClass("launchrock");
});
Assuming by page you mean page with all assets; if not, use $(function() { ... })
which only waits for the DOM API to be ready for use.
Upvotes: 3