August 1999
Intermediate to advanced
1488 pages
72h 53m
English
math.toString()The toString() method of the Math object returns a string value representing the object.
Listing 6.178 shows how the toString() method is used to get a string value representing the Math object.
<html> <body> <script language="JavaScript"> <!–– Hide // function returns string representation of math object function copy(){ var result = Math.toString(Math.sqrt(45)); document.form1.answer.value = result; } // End Hide ––> </script> <form name=form1> <input type="button" value="Get String" onClick='copy()'> <br> The result of toString is: <input type="text" name="answer" size=20> </form> ... |
Read now
Unlock full access