iPad is not writing text in the <input>

前端 未结 5 1182
轻奢々
轻奢々 2020-12-20 13:45

I\'m having trouble with the field when running my application on iPad.

On the desktop you click on the text box, type the text in and cl

5条回答
  •  醉话见心
    2020-12-20 14:17

    When you dynamically create an input or load html after the document.ready call, the jQuery .live() function is the ticket.

    So whereas normally you would have a function like this:

    $(function () {
    
        $('#text1').on('keyup', function() {
            // do something
        })
    })
    

    would become:

    function doSomething() {
        // do something
    }
    $(function () {
    
        $('#text1').live('keyup', doSomething);
    })
    

提交回复
热议问题