Javascript examples for DOM HTML Element:Anchor
Simulate a click on <a> element
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload = function() {/*from ww w . jav a 2s .c om*/ document.getElementById("gift-close").click(); }; </script> </head> <body> <a id="gift-close" href="javascript:void(0)" class="cart-mask-close p-abs" onclick="console.log('Test worked');" rel="coupon"> </a> </body> </html>