document.write('
解析:
公式:document.write(Math.floor(Math.random()*7));
使用函数:
(1)Math.random(); 结果为 0 ~ 1 间的一个随机数(包括 0,不包括 1)。
(2)Math.floor(num); 参数 num 为一个数值,函数结果为 num 的整数部分。
(3)Math.round(num); 参数 num 为一个数值,函数结果为 num 四舍五入后 的整数。