When you touch on a menu item in a web page on the iPhone, a picker view appears that allows you to select from the values that are in the menu.
I have a web page with a menu, but I'm trying to get the picker view to appear programmatically rather than have the user touch it first. This is my form
<form id="myForm">
<select id="mySelect">
<option value="a">a</option>
<option value="b">b</option>
<option value="c" selected>c</option>
<option value="d">d</option>
<option value="e">e</option>
</select>
</form>
I've tried the click() function on "mySelect" and I've tried adding focus first as below
$(document).ready(function() {
$('#mySelect').focus(function() {
$('#mySelect').click();
});
});
but nothing seems to work. I've tried this in Safari without success either, so it probably not webkit-specific.
What am I doing wrong?