iOS - Workaround for manually focusing on an input/textarea

前端 未结 5 1585
栀梦
栀梦 2020-12-05 13:07

So I\'ve seen a lot of threads about the iOS issue with focusing on an input/textarea element. (See here and here) It seems that iOS will not let you manually focus on one o

5条回答
  •  被撕碎了的回忆
    2020-12-05 13:40

    I used iPad Air [iOS 7.0.4], iPad Mini [iOS 7.1] and jQuery [1.11.3] for my test.

    The .focus event worked perfectly for me both in input and textarea fields.

    I am pasting the code below with which I tested. Please let me know if I am missing anything.

    Is it for some previous version of iOS / jQuery ?

    My HTML,

    
        
        
        
    
    

    My query,

    $('#btn').click(function(){
        $('#in').focus();
    })
    

提交回复
热议问题