Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
javascript / jquery / html / css /何か他のものが、入力フィールドに入るときに入力フィールド内のすべてのテキストをブロックすることは可能ですか?
n00bの質問のように聞こえますが、答えが見つかりません> _ <
入力のイベントが発生したdisabled後にjavascriptで追加できる属性を意味しますか?blur
disabled
blur
$("input[type=text]").blur(function(){ if($(this).val().length){ $(this).attr("disabled","disabled"); } });
トリックを実行する必要があります(テストされていませんが、機能するはずです)。