Just learned a quick lesson about jQuery events (think .focus, .blur, etc.) while talking through an issue with a new twitter friend. In order to make an event work it has to be inside your $(function(){}); (also known as $(document).ready(function() {}); also known as “once the DOM is ready”). So if you’re pulling your hair out because an event isn’t firing, make sure you’ve got it in the right place.

Examples:
$("input#textbox1").focus(function(){alert("focus");});will NOT work, but$(function(){
$("input#textbox1").focus(function(){alert("focus");});
});
will work.

similar stuff: