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.
外部スクリプトを使用onkeypressして、一意のを使用して入力の属性を設定する必要がありますid。を使おうとしまし$j('#numret').attr('onkeypress', 'calc();');たが、このコードは動作しませんでした。この属性を外部で変更する方法はありますか?
onkeypress
id
$j('#numret').attr('onkeypress', 'calc();');
イベントリスナーをアタッチします。
$j('#req').keypress(calc);
$("#req").keypress(function(event){ calc(); });