javascript - Focus on next form element directly after button -
how focus on next textarea comes after button clicked?
http://jsfiddle.net/infatti/gmpcz/
$('.add').click(function(){ $(this).closest('div').next('textarea:visible').focus(); });
closest()
starts current element , searches dom first element matching selector. div want isn't ancestor of link, sibling.
$('.add').click(function(){ $(this).next('div').find('textarea:visible:first').focus(); });
Comments
Post a Comment