已采纳回答 / Aug
ocon.style.display="none"; 你都隐藏了,h2的字体样式[ I love JavaScript ] 你就没法看到了.是不是想问的是这个
2015-06-05
操作成功!<br>
<span id="second">5</span>s后回到主页
<script type="text/javascript">
var second=5;
function a(){
second--;
if(second==0)
window.location="1.html";
else
document.getElementById("second").innerHTML=second;
}
setInterval(a,1000);
<span id="second">5</span>s后回到主页
<script type="text/javascript">
var second=5;
function a(){
second--;
if(second==0)
window.location="1.html";
else
document.getElementById("second").innerHTML=second;
}
setInterval(a,1000);
已采纳回答 / Mefa
setInterval("tiaozhuan",1000); 改成setInterval("tiaozhuan()",1000);然后加载一下<body onload="tiaozhuan()">,你的代码里只是定义了tiaozhuan()但是没有调用它,还有setInterval()最好返回一个值,像var timer = setInterval("tiaozhuan",1000); 当num=0的时候,调用clearInterval(time);将它停止
2015-06-05
var php = document.createElement('li');
php.innerHTML = 'PHP';
otest.insertBefore(php,otest.lastChild);
php.innerHTML = 'PHP';
otest.insertBefore(php,otest.lastChild);
2015-06-05
var myarry1=new Array();
myarry1=scoreStr.split(";");
var result=0;
for(var i=0;i<myarry1.length;i++)
{
myarry1[i]=myarry1[i].split(":");
result+=parseInt(myarry1[i][1]);
}
document.write("总分数是:"+result+"<br>");
document.write("平均分数是:"+result/myarry1.length);
拆分成二维数组,这样就不怕学生姓名和分数字符的长短了。
myarry1=scoreStr.split(";");
var result=0;
for(var i=0;i<myarry1.length;i++)
{
myarry1[i]=myarry1[i].split(":");
result+=parseInt(myarry1[i][1]);
}
document.write("总分数是:"+result+"<br>");
document.write("平均分数是:"+result/myarry1.length);
拆分成二维数组,这样就不怕学生姓名和分数字符的长短了。
第一:window.onunload = onunload_message();要加'()'吧,第二:没什么用啊,加载的时候出现,关闭没有用啊
2015-06-05
最赞回答 / 成者并非一蹴而就
浏览器对象模型 (BOM)所有浏览器都支持 window 对象。它表示浏览器窗口。所有 JavaScript 全局对象、函数以及变量均自动成为 window 对象的成员。全局变量是 window 对象的属性。全局函数是 window 对象的方法。
2015-06-05