テキスト入力ボックスにフォーカスがあたったときに中身を空にするサンプル
jQueryのバージョンは1.3.2。
$(function(){ $('input[type$="text"]').each(function(){ // type属性がtextのものを取得 $(this).focus(function() { $(this).attr('value',''); }); }); });
jQueryのバージョンは1.3.2。
$(function(){ $('input[type$="text"]').each(function(){ // type属性がtextのものを取得 $(this).focus(function() { $(this).attr('value',''); }); }); });