Javascript Safari移动浏览器不支持';t没有为<;选择选项;选择>;
我正在开发一个web应用程序,并在ipad上测试它,这时我意识到有些东西不起作用 我决定进一步研究,发现这在ipad上不起作用,但在桌面浏览器上会起作用:Javascript Safari移动浏览器不支持';t没有为<;选择选项;选择>;,javascript,ios,mobile-safari,Javascript,Ios,Mobile Safari,我正在开发一个web应用程序,并在ipad上测试它,这时我意识到有些东西不起作用 我决定进一步研究,发现这在ipad上不起作用,但在桌面浏览器上会起作用: $(function() { $('select').change(function(e) { console.log(e.srcElement.selectedOptions); }); }); Ipad控制台显示未定义的 这里有一个测试 我的方法错了吗?或者这是mobil
$(function() {
$('select').change(function(e) {
console.log(e.srcElement.selectedOptions);
});
});
Ipad控制台显示未定义的
这里有一个测试
我的方法错了吗?或者这是mobile safari中的一个bug?您的意思是使用e.srceelement.selectedIndex还是e.srceelement.value
e.srcElement.options[e.srcElement.selectedIndex].getAttribute("data-sort");
我需要能够找到
以从中获取属性,例如数据排序e.srceelement.options[e.srceelement.selectedIndex].getAttribute(“数据排序”);