$("input:text").focus(function() { $(this).addClass("hilight"); }) $("input:text").blur(function() { $(this).removeClass("hilight"); }); 名 前: <input id="txtName" type="text" /> メール: <input id="txtEmail" type="text" />