for(mymoney=1;mymoney<11;mymoney++)
{
sum= sum + mymoney;
}
这个不能通过
{
sum= sum + mymoney;
}
这个不能通过
2015-05-11
<script type="text/javascript">
var attime;
function clock(){
var time=new Date();
attime=time.getHours()+"时:"+time.getMinutes()+"分:"+time.getSeconds()+"秒"
document.getElementById("clock").value = attime;
}
setInterval(clock,100)
</script>
var attime;
function clock(){
var time=new Date();
attime=time.getHours()+"时:"+time.getMinutes()+"分:"+time.getSeconds()+"秒"
document.getElementById("clock").value = attime;
}
setInterval(clock,100)
</script>
2015-05-11
<script type="text/javascript">
function message(){
alert("不要移开,点击后进行慕课网!"); }
</script>
</head>
<body>
<form>
<a href="http://www.imooc.com" onmouseout="message()">点击我</a>
</form>
function message(){
alert("不要移开,点击后进行慕课网!"); }
</script>
</head>
<body>
<form>
<a href="http://www.imooc.com" onmouseout="message()">点击我</a>
</form>
2015-05-10
删除行<a href="javascript:;" onclick="removetr(this)"></a>,再创建removetr(obj)函数,obj代表传过来的<a>节点
var arr=scoreStr.split(";");
for(var i=0; i<arr.length;i++)
{
var value=arr[i].substr(arr[i].indexOf(":")+1);
sum += parseInt(value);
}
document.write(year+"年"+month+"月"+day+"日"+weekday[now.getDay()]+"</br>");
document.write("平均分="+Math.round(sum/arr.length));
for(var i=0; i<arr.length;i++)
{
var value=arr[i].substr(arr[i].indexOf(":")+1);
sum += parseInt(value);
}
document.write(year+"年"+month+"月"+day+"日"+weekday[now.getDay()]+"</br>");
document.write("平均分="+Math.round(sum/arr.length));
function里面的参数必须从小到大排列
<script type="text/javascript">
function sortNum(a,d) {
return d-a;
}
<script type="text/javascript">
function sortNum(a,d) {
return d-a;
}
2015-05-10
<script type="text/javascript">
function message(){
alert("不要移开,点击后进行慕课网!"); }
function dian(){
window.open("http://www.imooc.com" );
}
</script>
</head>
<body>
<form>
<input name = "button" type = "button" value = "点击我" onclick="dian()" onmouseout = "message()">
function message(){
alert("不要移开,点击后进行慕课网!"); }
function dian(){
window.open("http://www.imooc.com" );
}
</script>
</head>
<body>
<form>
<input name = "button" type = "button" value = "点击我" onclick="dian()" onmouseout = "message()">
2015-05-10
<script type="text/JavaScript">
function add3(x,y,z)
{
sum = x + y +z;
document.write(x+"、"+y+"、"+z+"和:"+sum+"<br/>");
}
add3(5,8,3);
add3(7,1,4);
</script>
function add3(x,y,z)
{
sum = x + y +z;
document.write(x+"、"+y+"、"+z+"和:"+sum+"<br/>");
}
add3(5,8,3);
add3(7,1,4);
</script>
2015-05-10
var infos=[['小A','女',21,'大一'], ['小B','男',23,'大三'],
['小C','男',24,'大四'], ['小D','女',21,'大一'],
['小E','女',22,'大四'], ['小F','男',21,'大一'],
['小G','女',22,'大二'], ['小H','女',20,'大三'],
['小I','女',20,'大一'], ['小J','男',20,'大三']];
['小C','男',24,'大四'], ['小D','女',21,'大一'],
['小E','女',22,'大四'], ['小F','男',21,'大一'],
['小G','女',22,'大二'], ['小H','女',20,'大三'],
['小I','女',20,'大一'], ['小J','男',20,'大三']];