Click here to Skip to main content
15,887,328 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
hi i want some help her


how to press Enter Key in Textbox in javascript

Press Enter in textbox when my page is load
Posted
Comments
Sandeep Mewara 5-May-12 13:02pm    
how to press Enter Key in Textbox in javascript

This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.
[no name] 6-May-12 4:07am    
Reason for my vote of 2
Explain It More?

1 solution

First of all, you can only press a key on your keyboard with your finger or another handy object :-); everything else would be some kind of simulation. You don't really want to press a key, you want to call some the same function which would be called on the key press. That said: create such function and call it from two (or more) places: in the handler of the event onkeydown and in the handler of the event onload. That's it.

—SA
 
Share this answer
 
Comments
Uday P.Singh 6-May-12 2:15am    
agree with your words! 5!
Sergey Alexandrovich Kryukov 6-May-12 11:24am    
Thank you, Uday.
--SA
Espen Harlinn 7-May-12 6:03am    
Good reply :-D
Sergey Alexandrovich Kryukov 7-May-12 12:16pm    
Thank you, Espen.
--SA
Maciej Los 7-May-12 6:33am    
As always, great answer! +5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900