clicking link in javascript -
i have anchor tag on pages.
<a id='signout' href='//somelocation'>signout</a>
and have javascript file available pages. there function called , attached 'click' , 'touch' , 'key press' handler trying click link. like
document.addeventlistener('click' function(e){ var signoff = document.getelementbyid('signout'); location = signoff.href; }
this should click anchor tag whenever there click event not working.
some syntax corrections got working me:
document.addeventlistener('click', function(e) { var signoff = document.getelementbyid('signout'); location = signoff.href; });
Comments
Post a Comment