onfocus jquery

JavaScript
$("#myID").focus(myfunction);
Source

Also in JavaScript: