Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • You could replace the evt assignment with evt = evt || event. The same goes for node. Commented Oct 31, 2011 at 22:30
  • @Romario thanks...not sure I completely understand what is happening here. Could you help me understand what that code is doing and in what sequence it gets executed? Thanks!! Commented Oct 31, 2011 at 22:39
  • first - we try to get the event in the function. If it is null we get window.event instead Commented Nov 1, 2011 at 15:34
  • then we get the node. If the node type is text and event key code is 13 (enter) then we return false, so event doesn't fire. Main thing to know is "? :" - look here hscripts.com/tutorials/javascript/ternary.php Commented Nov 1, 2011 at 15:39