Sorry for my lack of understanding of HTML/JavaScript, but I'm trying to simply click a button on a webpage to submit a form. The following is the html profile of the "submit" button.
<a href="javascript:" class="btn btn-success" id="btnSave">Submit</i></a>
I'm attempting to use the following JavaScript to click on it.
document.getElementById('btnSave').click()
I understand that sometimes DOM click()
doesn't always work, but I'm unable to come up with another solution or even understand why it won't.
Just for some background information, I don't own the website so I can't change the button code or the JavaScript. I'm attempting to run my JavaScript though AppleScript in Safari.
If I need to post the original page's JavaScript, I'll gladly do it.