How to real time display input value with jQuery?

后端 未结 4 971
悲哀的现实
悲哀的现实 2020-12-28 09:15


So that when user enter something inside \"#name\",will show it

4条回答
  •  难免孤独
    2020-12-28 09:56

    A realtime fancy solution for jquery >= 1.9

    $("#input-id").on("change keyup paste", function(){
        dosomething();
    })
    

    if you also want to detect "click" event, just:

    $("#input-id").on("change keyup paste click", function(){
        dosomething();
    })
    

    if your jquery <=1.4, just use "live" instead of "on".

提交回复
热议问题