LoginSignup
1
0

More than 5 years have passed since last update.

inputに対して、JQueryで値を変更を検知する方法(応用)

Posted at

掲題に対するメモ

//キーイベントの細かいところまで披露

// inputの中身の変化をリアルタイムで検知
$('body').on('keyup compositionend', '#post input',function() {
    myfunc();
}););   

//hidden要素などの変更検知

index.html
<input id="test" type="hidden" name="name" value="Your name" onchange="myfunc()">
<input type="submit" name="name" value="Your name" onclick="dataChange();">
javascript.js
function dataChange(){
    $('#test').val('my name').trigger('change');
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0