Detect enter key pressed using javascript [duplicate]
问题 Possible Duplicate: Javascript capture key I'm working on reply function using mysql and php. My MySQL db: reply: rid - id; topicid - under which topic; uid - id of the guy who replies; content - what did the guy said. Here's my html code: <form id="replyform"> <textarea name="rplcont" placeholder="Press enter to submit your reply."><textarea> </form> My question is: How do I know if enter button is pressed? Many thanks. / ---------------------------------------------- / here's my codes that