-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput-fixed.html
69 lines (68 loc) · 3.25 KB
/
input-fixed.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<html>
<head>
<title>
Accessible Inputs
</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 - Accessible Inputs</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;" 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; background-color: #e1d3c1;" 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>
<p>
<label for="input1" style="padding-right: 10px;">Enter Name</label>
<input id="input1" type="text"></input>
</p>
<p>
<label for="input2" style="padding-right: 10px;">Enter Email<span style="color:red;">*</span></label>
<input id="input2" type="text" required="required" aria-required="true"></input>
</p>
<div id="message" style="padding-bottom: 35px;">
<div id="heading1" style="display: none;">
<h2>Now has proper label association...</h2>
</div>
<div id="heading2" style="display: none;"><h2>Input field is now marked as required</h2></div>
</div>
<xmp id="code1" style="display: none;">
<label for="input1" style="padding-right: 10px;">
Enter Name
</label>
<input id="input1" type="text"></input>
</xmp>
<xmp id="code2" style="display: none;">
<label for="input2" style="padding-right: 10px;">
Enter Email<span style="color:red;">*</span>
</label>
<input id="input2" type="text" required="required" aria-required="true"></input>
</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>
$('#input1').on('focus', function() {
$('#heading1').show();
$('#code1').show();
$('#heading2').hide();
$('#code2').hide();
});
$('#input2').on('focus', function() {
$('#heading1').hide();
$('#code1').hide();
$('#heading2').show();
$('#code2').show();
});
</script>
</body>
</html>