麻烦老师帮忙检查一下代码,谢谢~
来源:1-25 编程练习
慕粉2243585596
2020-05-17 12:49:26
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>闪烁的文字</title>
<style type="text/css">
div{
width:200px;
height:200px;
line-height:200px;
border:2px solid gray;
text-align:center;
color:red;
}
</style>
</head>
<body>
<h3>会闪烁的文字</h3>
<div id="text"> </div>
<script type="text/javascript">
//补充代码
var div=document.getElementsByTagName("div")[0];
var time=0;
time=setInterval(function(){
if(time==0){
div.innerHTML="☆☆☆今日特卖☆☆☆"
time=1;
}else{
div.innerHTML="★★★今日特卖★★★"
time=0;
}
},500)
</script>
</body>
</html>1回答
好帮手慕星星
2020-05-17
同学你好,代码实现效果正确,很棒。继续加油,祝学习愉快~
相似问题