install event handler before html render code example Example: jquery ready // jQuery document ready function $(function() { // do stuff });