@@ -42,7 +42,7 @@ <h2>Hiding labels accessibly</h2>
4242 < 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 >
4343< code >
4444< 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>
4646<input type="text" name="username" id="username" value="" placeholder="Username"/>
4747</ pre >
4848</ code >
@@ -52,7 +52,7 @@ <h2>Hiding labels accessibly</h2>
5252< code >
5353< pre >
5454<div data-role="fieldcontain" < strong > class="ui-hide-label"</ strong > >
55- <label for="username"> Username:</label>
55+ <label for="username"> Username:</label>
5656 <input type="text" name="username" id="username" value="" placeholder="Username"/>
5757</div>
5858</ pre >
@@ -113,7 +113,7 @@ <h2>Field containers</h2>
113113 < p > For example:</ p >
114114< pre > < code >
115115<div data-role="fieldcontain">
116- <label for="name"> Text Input:</label>
116+ <label for="name"> Text Input:</label>
117117<input type="text" name="name" id="name" value="" />
118118</div>
119119</ code > </ pre >
@@ -146,30 +146,30 @@ <h2>Refreshing form elements</h2>
146146 < h4 > Checkboxes:</ h4 >
147147
148148< code >
149- $("input[type='checkbox']").attr ("checked",true).checkboxradio("refresh");
149+ $("input[type='checkbox']").prop ("checked",true).checkboxradio("refresh");
150150</ code >
151151
152152< h4 > Radios:</ h4 >
153153< code >
154- $("input[type='radio']").attr ("checked",true).checkboxradio("refresh");
154+ $("input[type='radio']").prop ("checked",true).checkboxradio("refresh");
155155</ code >
156156
157157< h4 > Selects:</ h4 >
158158< code > < pre >
159- var myselect = $("select#foo ");
159+ var myselect = $("#selectfoo ");
160160myselect[0].selectedIndex = 3;
161161myselect.selectmenu("refresh");
162162</ pre > </ code >
163163
164164< h4 > Sliders:</ h4 >
165165< code >
166- $("input[type=range]").val(60).slider("refresh");
166+ $("input[type=' range' ]").val(60).slider("refresh");
167167</ code >
168168
169169< h4 > Flip switches (they use slider):</ h4 >
170170
171171< code > < pre >
172- var myswitch = $("select#bar ");
172+ var myswitch = $("#selectbar ");
173173myswitch[0].selectedIndex = 1;
174174myswitch.slider("refresh");
175175</ pre > </ code >
0 commit comments