$("#city").val();
IOS取不到值的话可以用
var t = $(".pk-field").html(); var option = $("#city option"); for (var i = 0; i < option.length; i++) { if (t == option[i].text) { value = option[i].value; break; } }
来获取
改下载的源码,可能不对但可以参考下:
在js中 createOption 函数里面// Event listener
item.addEventListener('click', function(e) { e.preventDefault(); e.stopPropagation(); // Converting to array, because it is a (object) HTMLCollection [].slice.call(select.children).map(function(item, index) { if (index === data.index) { item.setAttribute('selected', 'selected'); $(select).trigger("change"); //主动触发onchange事件 return; } item.removeAttribute('selected'); }); feedInput(select, txt.innerHTML); closeModal(); }, false);