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

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

How do I make jquery click test



        
9条回答
  •  北海茫月
    2021-02-19 05:07

    your above code will not work because you have assigned value in href and then you want some operation onclick of this anchor tag.

    test
    

    first of all you have assigned .zip to href. So it will open zip file onclick first and will not trigger any other operation in onclick trigger.

    so whatever operation you want to do , perform it first then open .zip

    use code like below

    test
    
    $('#mylink').click(function(){
        // do your operation here
        // now open zip 
    });
    

提交回复
热议问题