$(document).ready(function(){ $("#ajaxSearch_input").each( function () { $(this).focus(function () { $(this).val(""); },function(){ }); }); });