Difference between revisions of "Anchor with no href"

From Level Access Web Labs
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
<script>
 
<script>
 
   function check() {
 
   function check() {
     if (event.keyCode == 32) || (event.keyCode == 28)  
+
     if (event.keyCode == 32 || event.keyCode == 13) {
 
       window.location = "http://www.google.com";
 
       window.location = "http://www.google.com";
 +
      event.preventDefault()
 +
    }
 
   }
 
   }
 
</script>
 
</script>
Line 12: Line 14:
 
<body>
 
<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>
 
</body>
 
</html>
 
</html>

Latest revision as of 13:54, 26 November 2018

Anchor with no href but with onclick and tabindex but no role.

Our site Our site