The toString() method returns a string value representing the object.
<html>
<body>
<script language="JavaScript">
<!--
function copy(){
var result = Math.toString(Math.sqrt(45));
document.form1.answer.value = result;
}
-->
</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>
</body>
</html>
9.29.toString |
| 9.29.1. | Math.toString() |