When I click a button I want the textarea
in this li
element to focus.
Based on your comment in reply to Jacob, perhaps you want:
$('.user-status-buttons').click(function(){
var id = $(this).attr('id');
$("#commentbox-"+id).slideToggle("fast", function(){
$("#commentbox-"+id+" #StatusMessageReplyMessage").focus();
});
return false;
});
This should give the #StatusMessageReplyMessage
element focus after the slide effect has finished.