$('a').trigger('click'); not working

后端 未结 9 2434
南旧
南旧 2021-02-19 04:06

How do I make jquery click test



        
9条回答
  •  忘了有多久
    2021-02-19 04:47

    document.getElementById('mylink').click();
    

    trigger('click') will fire the click event but not the default one.

    $('a').click(function(){ alert('triggered') }) // this will be fired by trigger
    

提交回复
热议问题