<body>
<input type="text" value="ios端点击document,input框不会失去焦点">
<input class="input" type="text" value="已hack,点击document可失去焦点">
<script>
window.onload = function() {
document.querySelector('body').addEventListener('touchend', function(e) {
if(e.target.className != 'input') {
document.querySelector('.input').blur();
}
});

}
</script>
</body>

相关文章:

  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
  • 2021-12-04
猜你喜欢
  • 2022-12-23
  • 2021-05-31
  • 2021-12-20
  • 2022-12-23
  • 2021-12-09
  • 2021-11-03
相关资源
相似解决方案