上机作业2过程记录
- JavaScript中的等号问题,如if(i%2===0)这里为三个等号,而非如Java中的两个等号。同样,不等号也非“!=”,而是“!==”。
- getElementById
getElementsByClassName
getElementsByName
getElementsByTagName
getElementsByTagNameNS - 在循环图片的基础上,鼠标移到图片上时停止并放大图片,鼠标移开继续循环图片
(1)在img标签中加style属性以设置height与width
(2)在<script></script>中写bigger()方法,将height与width值改大即可,同时“clearInterval(tr)”以停止图片循环,tr= setInterval(cycle,800)。
(3)在img标签中加鼠标事件,为“onmouseover="bigger()"”
(4)“鼠标移开继续循环”则在设置一个small()方法,将height与width设为最初值,调用循环图片的方法使之继续循环
4、数字时钟
(1)取时间
Ps:因为初始带有注释等非时间信息,且在小于10的时、分、秒数前加0
(2)将数字改为图片
5、设置题目,一定时间后题目消失,点击按钮判分
(1)在<head></head>中
(2)在<body></body>中
<p>1、你喜欢吃什么水果</p>
<form>
<input type="radio" name="score" value="1">苹果
<input type="radio" name="score" value="2">香蕉
<input type="radio" name="score" value="3">梨
<input type="radio" name="score" value="4">桃子
<input type="radio" name="score" value="5">其他</form>
如此设置所需要的题目