This is triggered as soon as the dom is ready for manipulation
$(document).ready(function() { // dom related code goes here });
This is even shorter and does the same:
$(function(){ // dom related code goes here });