Difference between revisions of "Anchor with no href"
Jump to navigation
Jump to search
(4 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
<html> | <html> | ||
+ | <head> | ||
<script> | <script> | ||
function check() { | function check() { | ||
− | if (event.keyCode == 32 | + | if (event.keyCode == 32 || event.keyCode == 13) { |
window.location = "http://www.google.com"; | window.location = "http://www.google.com"; | ||
+ | event.preventDefault() | ||
+ | } | ||
} | } | ||
</script> | </script> | ||
+ | </head> | ||
+ | <body> | ||
<a onclick="window.location = 'http://www.google.com';" tabindex="0" onKeyup="check();"> Our site </a> | <a onclick="window.location = 'http://www.google.com';" tabindex="0" onKeyup="check();"> Our site </a> | ||
+ | <a onclick="window.location = 'http://www.google.com';" onKeyup="check();"> Our site </a> | ||
+ | |||
+ | </body> | ||
</html> | </html> |