I'm trying to click an element with an < a > tag using jquery. It works in the Chrome console, but it doesn't work from the extension. What am I doing wrong?
This is what I'm trying to 'click':
<a href="" id="roblox-confirm-btn" class="btn-large btn-negative">Yes<span class="btn-text">Yes</span></a>
This is what I use in the console, it works fine:
var thing = $("a#roblox-confirm-btn")
thing.click()
This is what I use in the chrome background.js, it doesn't work:
setTimeout(function() {
//NOTE: 'click?' IS being printed into the console, and I'm getting no error
console.log("click?")
var thing = $("a#roblox-confirm-btn")
thing.click()
}, 2000)