Within this paragraph, there is an anchor tag that I am trying to access using its id in javascript:
<p>Please check out <a id="myblog" href="/myblog/"> My Blog </a></p>
I attempted to retrieve the tag using the following code in my .js file:
var target = document.getElementById("myblog");
However, the target variable ended up empty. What could be the reason for this?