I want to use a userscript to automatically click on a button when a page is loaded.
The target page's HTML (which I do not control) looks like this:
<a id="signInBtn" alog-alias="qb-signin-btn" class="signInBefore btn btn-24-white grid" data-disabled="false" hidefocus="hidefocus">
<em><b>CheckIn</b></em>
</a>
It is a strange link without an href
attribute. I am trying to use this code:
var btn = $("a#signInBtn");
btn.trigger("click");
But Chrome's console gives me this:
Error in event handler for (unknown):
Error: Syntax error, unrecognized expression: a[href^=/i?]
How can my userscript click this button?