I have is a hidden div. When the button is clicked, the div slides down with an input field. How do I make this input field autofocus as soon as the div slides down? Thanks.
hidden field cannot gain focus ..so what you need to do is on click of button you have to show them .
$("#status_comments_"+a).show().slideDown(); $("#comment_field").show().focus();