I have a page that contains a dynamic anchor link and image and I would like the user to be able to press enter to automatically follow that link. I was able to do this but I'm not sure if this is the right solution. I guess my question is ... Is this the only or best way to simulate a click with a key stroke?
Here is what I have so far:
if (event.keyCode== 13)
//Submit Anchor link...
var elem = document.getElementById('m
window.location = elem;
<H1>This is a test</H1>
<A id=mylink href="http://www.yahoo.com