ios input 聚焦调起软键盘 问题

ios下input不支持自动聚焦,可通过点击按钮调起软键盘

<input type="text" id="input-elem">

<button id='btn'>测试</button>

<script>

var button = document.getElementById('btn');

var inputElem = document.getElementById('input-elem');

button.addEventListener('click', function(ev){

inputElem.focus();

})

</script>

猜你喜欢

转载自blog.csdn.net/qq_33040483/article/details/81352994