-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
52 lines (51 loc) · 2.74 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<html>
<head>
<title>
Broken Anchor
</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body>
<div style="padding: 50px;">
<h1>Basic Web Accessibility - Broken Anchor</h1>
<p>Try and reach the element(s) below using just your keyboard. If you can't, use your mouse.</p>
<hr />
<nav style="padding-bottom: 35px;">
||
<a style="padding-left: 10px; padding-right: 10px; background-color: #e1d3c1;" href="index.html">Broken Anchor</a> ||
<a style="padding-left: 10px; padding-right: 10px;" href="a-fixed.html">Accessible Anchor</a> ||
<a style="padding-left: 10px; padding-right: 10px;" href="input-broken.html">Broken Inputs</a> ||
<a style="padding-left: 10px; padding-right: 10px;" href="input-fixed.html">Accessible Inputs</a> ||
<a style="padding-left: 10px; padding-right: 10px;" href="button-broken.html">Broken Button </a> ||
<a style="padding-left: 10px; padding-right: 10px;" href="button-fixed.html">Accessible Button</a> ||
<a style="padding-left: 10px; padding-right: 10px;" href="tabindex.html">Tabindex</a> ||
</nav>
<a id="link" style="margin-bottom: 35px;">This is a link...</a>
<div id="message" style="padding-bottom: 35px;">
<div id="heading" style="display: none;">
<h2>...without an href!</h2>
<em>
If you create an <code>anchor</code> element without an <code>href</code> your link will render and look correct. It will even behave correctly if you attach JS event listeners to it.<br />
However, this is invalid HTML and without an <code>href</code> property, the <code>anchor</code> loses its <code>tabindex</code> and can no longer be discovered via keyboard.
</em>
</div>
</div>
<xmp id="code" style="display: none;">
<a id="link" style="margin-bottom: 35px;">
This is a link...
</a>
</xmp>
<footer id="footer" style="padding-top: 80px; font-size=8px;">
Copyright © 2017 <a href="https://github.com/radicalsauce">Radicalsauce Labs</a>
</footer>
</div>
<script>
$('#link').on('click', function() {
$('#heading').toggle(this.display);
$('#code').toggle(this.display);
});
</script>
</body>
</html>