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.
フォーム内に 2 つの入力フィールドがあり、onkeyup を使用して最初の入力フィールドの値を 2 番目の入力フィールドの alt プロパティに追加したいと考えています。
Javascriptを使用してどのように行うことができますか?
jQueryの使用をお勧めします
$('#field1').keyup(function(){ $('#field2').attr('alt', $(this).val()); });
やりたいことをやればいい。