I was attempting to click on an element of a webpage that looked something like this:
<div class="a_class">
<a id="an_id" class="class2">
<span>Text</span>
</a>
</div>
I already tried using document.getElementById("an_id").click();
and it returns telling me it is undefined. Any ideas as to what's going wrong?