i'm trying click programmatically button web page using chrome console.
(updated)the code of button looks :
<form method=get action="/xxx/yyy/kkk.jsp" > <input type="hidden" name="page" value="721"> <input type="hidden" name="reqtype" value="reprinto"> <input type="hidden" name="title" value="reprint label"> <input type="hidden" name="system" value="reprint"> <td align=right width=25%><input type=submit value='>' name=btn_choice5/> <td> reprint label </form>
there couple more buttons on page have value= '>'
, guess need click using name. tried document.queryselector('input[name="btn_choice4"]').click();
, didn't work. how click button using js?
if have id attribute can use
$('#btnid').click();
or if want go name, can use
$('[name="somename"]').click();
but if use id not name if multiple controls have same name attribute , value, controls click event invoked.