Simulate a click on 'a' element using javascript/jquery

前端 未结 8 2267
别跟我提以往
别跟我提以往 2020-12-04 17:08

I am trying to simulate a click on on an element. HTML for the same is as follows



        
8条回答
  •  一生所求
    2020-12-04 18:11

    Try adding a function inside the click() method.

    $('#gift-close').click(function(){
      //do something here
    });
    

    It worked for me with a function assigned inside the click() method rather than keeping it empty.

提交回复
热议问题