0
<a href="#addnotes" onclick="javascript:submitAddNotes();">

How would i submit js simulated click on this ?

  • Can't you just run submitAddNotes()? Without simulating a click – Jacob Petersen Nov 09 '15 at 21:02
  • FYI, don't prefix inline event handlers with `javascript:`. It has no use whatsoever. You could also write `onclick="asdkjfhakjhkja:submitAddNotes();"` and it would have the same effect. – Felix Kling Nov 09 '15 at 21:05

1 Answers1

6

Like this:

var anchor= document.querySelector('a[href="#addnotes"');
anchor.click();
Rick Hitchcock
  • 35,202
  • 5
  • 48
  • 79