How to trigger click on a button

后端 未结 2 1499
醉梦人生
醉梦人生 2020-11-29 11:49

I\'ve this page. I need to trigger a click on the BUY NOW button on this page using AngularJS.

I\'ve tried these ways to click on this \"BUY NOW\" in content script(

2条回答
  •  清歌不尽
    2020-11-29 12:40

    What about Vanilla JS, noone prohibited?

    Such as "onlick/click"?

    function ae(a,b,c) {
     if (a.addEventListener)
         a.addEventListener (b,c,false);
     else if (a.attachEvent)
         a.attachEvent ('on'+b,c); 
    }
    function re(a,b,c) {
     if (a.removeEventListener) 
        a.removeEventListener (b,c,false);
     if (a.detachEvent)
        a.detachEvent ('on'+b,c); 
    }
    

提交回复
热议问题