How do I accomplish this in HTML/JavaScript?

I'm wondering how you bond keys with commands. I have two input boxes with a button beside them. I have made a function that will alert (in javascript) the user of the quotient of the numbers. How can I make it so that after the numbers have been entered one needs only press enter to activate the button? Also, in related addition, how do I make logical comparisons with "NaN"meaning "Not a Number".

Thank you very much,
 
Back
Top