I have this html code:
FOO FOO2
Try with this:
$('b.edit').click(function(e){ //When you use an event is better //send the event variable to the //binding function. var id = e.target.id; //get the id of the clicked element. /*do your stuff*/ $('.editP').focus(); });