How to get form data:
1. Note The ID of the form
2. Use document.getElementById ("num"). value to get values
3. It is important to note that you now get a string type that can be used with alert (typeof (NUM)) to get the data type
4. Use the parseint function to convert a string type to an int type, and then determine
5.!!!!!!!!!!!!! Note to write. Value, I forgot again, find the bug again ...
<!DOCTYPE HTML><HTML><Head> <MetaCharSet= "UTF-8"> <title>Js</title> <Scripttype= "Text/javascript"> functionGetmax () {//get the values in the form varNUM1=parseint (document.getElementById ("NUM1"). Value); varnum2=parseint (document.getElementById ("num2"). Value); //Output //document.write ((Num1 > Num2) num1:num2);alert ((NUM1>num2)?num1:num2); } </Script></Head><Body>Number one:<inputtype= "text"ID= "NUM1" />Number two:<inputtype= "text"ID= "Num2" /> <inputtype= "Submit"onclick= "Getmax ()" /></Body></HTML>
8.javascript gets the two numbers in the form and determines the size