请问我这句代码,为什么不能实现,大谢

来源:7-16 随机数 random()

qq_曹振_0

2017-08-29 14:44

document.write(Math.round(parseInt((10*Math.random();)););

写回答 关注

3回答

  • Summer丶丶丶
    2017-08-29 14:50:11
    已采纳

    你可以选着把前面的两个分号去掉

    qq_曹振_...

    说的对,我分号写的太差了,只有程序结束才能用分号,学到了/允悲

    2017-08-29 15:05:59

    共 1 条回复 >

  • qq_曹振_0
    2017-08-29 15:04:54

    几番尝试成功执行了,原来代码函数里面可以镶嵌代码函数document.write(Math.round(parseInt(10*Math.random())));

  • qq_曹振_0
    2017-08-29 14:56:46

    document.write(Math.round(parseInt(10*Math.random();)););我发现了错误多了个括号,去掉还是不能运行


JavaScript进阶篇

本课程从如何插入JS代码开始,带您进入网页动态交互世界

467392 学习 · 21877 问题

查看课程

相似问题