How to call function from text input key press in javascript?

后端 未结 3 1634
耶瑟儿~
耶瑟儿~ 2021-01-24 05:38

With


the alert box displays the value in the box, not included the current key dep

3条回答
  •  渐次进展
    2021-01-24 06:10

    First thing is avoid using js code inside html tags it is a bad practice , you can use the keyup event to get the content of the input after the user release any pressed key

    
    
    
    

提交回复
热议问题