@@ -42,7 +42,7 @@ <h2>Hiding labels accessibly</h2>
42
42
< p > For the sake of accessibility, jQuery Mobile requires that all form elements be paired with a meaningful < code > label</ code > . To hide labels in a way that leaves them visible to assistive technologies—for example, when letting an element’s < code > placeholder</ code > attribute serve as a label—apply the helper class < code > ui-hidden-accessible</ code > to the label itself:</ p >
43
43
< code >
44
44
< pre >
45
- <label for="username" < strong > class="ui-hidden-accessible"</ strong > > Username:</label>
45
+ <label for="username" < strong > class="ui-hidden-accessible"</ strong > > Username:</label>
46
46
<input type="text" name="username" id="username" value="" placeholder="Username"/>
47
47
</ pre >
48
48
</ code >
@@ -52,7 +52,7 @@ <h2>Hiding labels accessibly</h2>
52
52
< code >
53
53
< pre >
54
54
<div data-role="fieldcontain" < strong > class="ui-hide-label"</ strong > >
55
- <label for="username"> Username:</label>
55
+ <label for="username"> Username:</label>
56
56
<input type="text" name="username" id="username" value="" placeholder="Username"/>
57
57
</div>
58
58
</ pre >
@@ -113,7 +113,7 @@ <h2>Field containers</h2>
113
113
< p > For example:</ p >
114
114
< pre > < code >
115
115
<div data-role="fieldcontain">
116
- <label for="name"> Text Input:</label>
116
+ <label for="name"> Text Input:</label>
117
117
<input type="text" name="name" id="name" value="" />
118
118
</div>
119
119
</ code > </ pre >
@@ -146,30 +146,30 @@ <h2>Refreshing form elements</h2>
146
146
< h4 > Checkboxes:</ h4 >
147
147
148
148
< code >
149
- $("input[type='checkbox']").attr ("checked",true).checkboxradio("refresh");
149
+ $("input[type='checkbox']").prop ("checked",true).checkboxradio("refresh");
150
150
</ code >
151
151
152
152
< h4 > Radios:</ h4 >
153
153
< code >
154
- $("input[type='radio']").attr ("checked",true).checkboxradio("refresh");
154
+ $("input[type='radio']").prop ("checked",true).checkboxradio("refresh");
155
155
</ code >
156
156
157
157
< h4 > Selects:</ h4 >
158
158
< code > < pre >
159
- var myselect = $("select#foo ");
159
+ var myselect = $("#selectfoo ");
160
160
myselect[0].selectedIndex = 3;
161
161
myselect.selectmenu("refresh");
162
162
</ pre > </ code >
163
163
164
164
< h4 > Sliders:</ h4 >
165
165
< code >
166
- $("input[type=range]").val(60).slider("refresh");
166
+ $("input[type=' range' ]").val(60).slider("refresh");
167
167
</ code >
168
168
169
169
< h4 > Flip switches (they use slider):</ h4 >
170
170
171
171
< code > < pre >
172
- var myswitch = $("select#bar ");
172
+ var myswitch = $("#selectbar ");
173
173
myswitch[0].selectedIndex = 1;
174
174
myswitch.slider("refresh");
175
175
</ pre > </ code >
0 commit comments