

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to fire after pressing ENTER in text input with HTML?
Use HTML with jQuery to achieve this and fire after pressing ENTER −
Example
<!DOCTYPE html> <html> <head> <script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $('input').bind("enterKey",function(e){ alert("Enter key pressed"); }); $('input').keyup(function(e){ if(e.keyCode == 13) { $(this).trigger("enterKey"); } }); }); </script> </head> <body> <input type = "text"> <p>Press Enter key in the above input text.</p> </body> </html>
- Related Questions & Answers
- How to simulate pressing enter in html text input with Selenium?
- JavaScript Submit textbox on pressing ENTER?
- How to detect pressing Enter on keyboard using jQuery?
- Detect the ENTER key in a text input field with JavaScript
- Lose input hints (get focus) after pressing mouse cursor in a textbox with JavaScript
- How to trigger click event on pressing enter key using jQuery?
- Programmatically fire HTML5 dragstart after mousemove
- HTML DOM Input Text object
- How to Create a Multi-line Text Input (Text Area) In HTML?
- What is the jQuery Event for user pressing enter in a textbox?
- HTML DOM Input Text size Property
- HTML DOM Input Text type Property
- HTML DOM Input Text value Property
- HTML DOM Input Text autocomplete Property
- HTML DOM Input Text autofocus Property
Advertisements