<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript"> var v1=prompt('请输入第一个值'); v1=Number(v1); var v2=prompt('请输入第二个值'); v2=Number(v2); var v3; v3=v1+v2; document.write(v1+'+'+v2+'='+v3) </script> </head> <body> </body> </html>