jQuery get input value after keypress

后端 未结 9 1613
野趣味
野趣味 2020-11-28 21:40

I have the following function:

$(document).ready(function() {
    $(\"#dSuggest\").keypress(function() {
        var dInput = $(\'input:text[name=dSuggest]\'         


        
9条回答
  •  眼角桃花
    2020-11-28 22:05

    jQuery get input value after keypress

    https://www.tutsmake.com/jquery-keypress-event-detect-enter-key-pressed/

    i = 0;  
    $(document).ready(function(){  
        $("input").keypress(function(){  
            $("span").text (i += 1);  
        });  
    }); 
      
      
      
    jQuery keyup() Method By Tutsmake Example 
    
      
      
    Enter something:   
    

    Keypresses val count: 0

提交回复
热议问题