0

私には十分に明確ではなかったというだけで、すでに回答が存在する可能性があるため、この質問をすることをお詫びします。HTML texbox コントロールに jquery 変更イベントを適用する最良の方法は何ですか?

4

3 に答える 3

0

テキストエリアのことですか?このようなもの:

$('textarea').on('keydown', function() {
    //Do stuff
    console.log('Do something smart here!');
});
于 2013-06-20T08:59:03.183 に答える
0

以下のサンプルコードをお試しいただけますでしょうか。

<input type="text" class="common" />

<input type="text" class="common" />

<input type="text" class="common" />

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" ></script>

<script type="text/javascript">

 $(document).ready(function () {
     $("input.common[type='text']").change(function () {
        var value = this.value;
        alert(value);
     });
 });

</script>

于 2013-06-20T09:00:58.833 に答える