JavaScript onkeyup Event
This section illustrates you the use of onkeyup event in JavaScript.
In the given example, we are going to show you how to display the text of textField1 on the text field2 on key up. For this purpose, we have created two text fields text1 and text2. On pressing the key to write the text on the textbox1, you will see that the same text will start displaying on the textbox2. This is possible by using the onkeyup event. It occurs when a keyboard key is released.
Following code copies the value of textbox 1 to textbox2:
| document.form.text2.value = document.form.text1.value; |
Here is the code:
| <html> <h2>TextBox shows Key Event</h2> <script language="JavaScript"> function display() { document.form.text2.value = document.form.text1.value; } </script> <form name="form"> TextBox1: <input type="textbox" id="text1" onkeyup="display();"><br> TextBox1: <input type="textbox" id="text2" > </form> </html> |
Output will be displayed as:

Tutorials
- Clear cookie example
- JavaScript getElementById innerHTML
- JavaScript getElementById Style
- Javascript Examples
- JavaScript add row dynamically to table
- New Page 1
- JavaScript Change link
- JavaScript Checkbox getElementById
- javascript clear textarea
- JavaScript Clock Timer
- JavaScript Cookies
- JavaScript Date Difference
- JavaScript duplicate string
- JavaScript Email Validation
- javascript focus input
- JavaScript get excel file data
- JavaScript getAttribute Href
- JavaScript getAttribute Style
- JavaScript getElementById div
- JavaScript getElementById Iframe
- JavaScript getElementById select
- JavaScript Hide Button
- JavaScript Hide Div
- JavaScript hide image
- JavaScript Hide Table Column
- JavaScript Hide Table Rows
- JavaScript Key Event
- JavaScript link
- JavaScript method location
- JavaScript move div
- JavaScript move file
- JavaScript move image
- JavaScript Navigate Back
- JavaScript navigate to page
- JavaScript Navigate to URL
- JavaScript indexOf substring
- JavaScript onkeypress event
- JavaScript Open file
- JavaScript Open link in new window
- JavaScript Open Modal Window


