-3

Here is the code for the button that needs pressed:

<div id="ccBtns">
  <input type="button" name="" value="submit" class="startSessionButton submit required">
  <div class="clear"></div>
</div>

I tried using: document.getElementById('submit').click();

I am using this code in a plugin called Autofill for chrome.

EDIT: I found that his works document.querySelector('input[type=button]').click();

Andrew D
  • 11
  • 1
  • 1
  • 2
  • Possible duplicate of [Can javascript click a div?](http://stackoverflow.com/questions/29006288/can-javascript-click-a-div) – AlexG Sep 28 '16 at 15:02

1 Answers1

1

Your code is wrong becouse you try to click a button with id equals to submit.

Your button doesn't have id like that. Try that:

document.getElementsByClassName('submit').click();
Shaq
  • 377
  • 5
  • 16