html - Javascript trigger submit button -


i tried googled nothing helped me.
want trigger following button:

<input class="btn btn_large btn_green" value="go" type="submit"> 

if element id work charm:

document.getelementbyid('btn btn_large btn_green').submit(); 

but since can't assign id button isn't working.
if try call via

document.getelementsbyclassname("").submit(); 

it isn't working.

thanks in advance

you can try document.queryselector():

you can select class using "." , click element submit.

var button = document.queryselector('.btn.btn_large.btn_green');  console.log(button);  button.click();
<input class="btn btn_large btn_green" value="go" type="submit">


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -