<!DOCTYPE HTML> <html > <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>函数</title> <script type="text/javascript"> function aa(x,y) { if(x>y) { return x; } else if(x<y) { return y; } else { return "两个数相等"; } } document.write(" 5 和 4 的较大值是:"+ aa(5,4)+"<br>"); document.write(" 6 和 3 的较大值是:"+ aa(6,3) ); </script> </head> <body> </body> </html>
Can’t find the problem, just can’t compile the results - PHP Chinese website Q&A - Can’t find the problem, just can’t compile the results - PHP Chinese website Q&A
Take a look around and learn.
return "两个数相等"; 你这句用的是中文的分号,改成英文的就行了。