I'm using jQuery mobile's flip switch and by default the switches are off. I can't figure out how to set the default value to 'ON'
<form id="sound-switch">
<select name="flip-3" id="snd-switch" data-role="flipswitch" data-mini="true">
<option value="off">Off</option>
<option value="on">On</option>
</select>
</form>
I read somewhere to add value="on"
to the html but I can't get it to work. Does anyone have any experience with this?
Try
Added
selected="selected"
to On so that it is selected when it page loads.By default always first option is selected
Fiddle Demo
Check here http://validator.w3.org/check
SELECTED
is not a member of a group specified for any attributeusing
SELECTED
will work but not pass w3 says invalid :)use
selected="selected"