How to real time display input value with jQuery?

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


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

4条回答
  •  北海茫月
    2020-12-28 09:47

    The previous answers are, of course, correct. I would only add that you may want to prefer to use the keydown event because the changes will appear sooner:

    $('#name').keydown(function() {
        $('#display').text($(this).val());
    });
    

提交回复
热议问题