Usually when I make a click using javascript, it’ll look something like the following:
$(document.elementFromPoint(x, y)).click();
$(document.getElementById('ID_HERE')).click();
Now, I’ve run in to a problem where neither of these methods work. I have a button that needs to be pressed, it has no ID and clicking with elements coords doesn’t seem to work. This is what the button looks like.
<input type="submit" value="I accept" onclick="SignUp.DoPost();return false;" title="I accept" class="default">
Now, there are other elements within the HTML with the title “I accept”. How can I have javascript make a click if an input element has both the value and title “I accept”? And possible even add the onclick in there too to really make sure it picks the correct element?
1 Answer