<html> <head> <title>绝对值函数的使用</title> </head> <body> <script language="javascript"> <!-- document.write("0的绝对值为:",Math.abs(0),"<br>"); document.write("1的绝对值为:",Math.abs(1),"<br>"); document.write("-1的绝对值为:",Math.abs(-1),"<br>"); //--> </script> </body> </html>