-hjj
<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>Document</title>
 </head>
 <body>
  <script>
		//1、弹出一个输入框,输入数据
		var input=window.prompt("输入一个数字:");
		//2、将输入的数据+10,并打印输出
		/*input = input + 10;
		console.log(input);*/
		//3、注销上一步,使用typeof查看数据的数据
		console.log(typeof(input));
		//4、将输入的数据转换为数字,再+10
		console.log(Number(input) + 10);
	</script>
 </body>
</html>

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-04-21
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2022-02-16
  • 2021-11-17
  • 2021-04-05
猜你喜欢
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
相关资源
相似解决方案