In Mobile Safari on the iPad, it seems that if there is no option selected on a <select>
element, then the user cannot select the 0th option before selecting another one first (try it on http://jsfiddle.net/PJTKq/ on an iPad).
To be more specific:
<select>
element with two or more options.selectedIndex = -1
or removing the "selected"
attribute from all the <option>
elements.Does anyone know of a workaround (besides inserting an empty dummy option) that would allow moving directly from selectedIndex
-1 to selectedIndex
0?
Try to load a website, like www.apple.com, using cellular data. If you don't have cellular data, connect to a different Wi-Fi network and then load the website. If you're using a VPN (Virtual Private Network), check your VPN settings. If you have a VPN turned on, some apps or websites might block content from loading.
Update Your iPhone Since Safari is a native iOS app, updating your iPhone is the only way to update the app too. Open Settings and tap General -> Software Update. Tap Download and Install if an iOS update is available. After the update is complete, open Safari and see if it's working again.
<script>
// with jQuery
var iPad = !!navigator.userAgent.match(/iPad/i),
select = "select";
if(iPad === true) {
$(select).prop("selectedIndex", 0);
}
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With