JavaScript click a button by name from chrome console

后端 未结 4 563
刺人心
刺人心 2021-01-01 04:30

I\'m trying to click programmatically a button from a web page using chrome console.

(UPDATED)The code of the button looks like this :

<         


        
4条回答
  •  星月不相逢
    2021-01-01 05:10

    Like Rakesh said, $('#btnId').click(); works.

    Easy mode, though, is to right click the element in the browser, click inspect (or find it in the elements selector, then select it), then simply fire the event on the selected element:

    $0.click();
    

提交回复
热议问题