How to programmatically trigger the click on a link using jQuery?

前端 未结 4 1062
被撕碎了的回忆
被撕碎了的回忆 2020-11-28 14:18

How to programmatically trigger the click on a link using jQuery?

4条回答
  •  萌比男神i
    2020-11-28 14:40

    $('#your_link_id')[0].trigger('click');
    

    is needed as jQuery returns an array and we cannot trigger click on multiple eventlinks. You have to target only a single element

提交回复
热议问题