LoginSignup
55
62

More than 5 years have passed since last update.

【jQuery】イベント発火方法

Posted at
html
<button>挨拶</button>
jQuery
$('button').click(function(){
  alert('hello');
})

があったとして、jQuery上からクリックイベントを実行(発火)する方法は二通り。

jQuery
$('button').trigger('click');

または、

jQuery
$('button').click();
55
62
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
55
62