焦点/点击时是否可以选择 iPhone 设备上的所有输入文本?
通常对于浏览器环境,人们会使用:
$('input').bind("click focus", function() {
$(this).select();
});
这适用于桌面浏览器,但对于 iPhone 和可能的其他移动设备似乎没有响应。
最佳答案
基本上,您必须重新排列事件焦点,然后单击,然后触摸启动
$('#myID').on('focus click touchstart', function(e){
$(this).get(0).setSelectionRange(0,9999);
//$(this).css("color", "blue"); FUBAR
e.preventDefault();
});
关于jquery - 当焦点/单击时,是否可以选择 iPhone 设备上的所有输入文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10452391/