Javascript examples for DOM Event:onclick
Hide outline focus on link when click
<html lang="en"> <head> <style> a:focus, a:active { outline:0; } a.tabbed {//from ww w .j av a 2 s . c om outline:1px solid red; } </style> </head> <body translate="no"> <a href="#">link 1</a> <a href="#">link 2</a> <a href="#">link 3</a> <script> document.addEventListener('keyup', function (e) { var code = e.keyCode ? e.keyCode : e.which; var el = document.activeElement; console.log('key event'); if (code == 9 && el.tagName == 'A') { el.className = "tabbed"; console.log("tabbed"); } }, true); </script> </body> </html>