javascript问题,看看代码错哪了(评分控件)
<head><title></title><scripttype="text/javascript">functionMouseIn(){vartablescore=do...
<head>
<title></title>
<script type="text/javascript">
function MouseIn() {
var tablescore = document.getElementById("tablescore");
var tds = tablescore.getElementsByTagName("td");
for (var i = 0; i < tds.lenth; i++) {
tds[i].onmouseover = tdOnMouseOver(tds, i);
tds[i].style.cursor = "pointer";
}
}
function tdOnMouseOver(tds, loc) {
for(var i = 0; i <= loc; i++) {
tds[i].innertext = "★";
}
for (i = loc; i < tds.lenth; i++) {
tds[i].innertext = "☆";
}
}
</script>
</head>
<body onload="MouseIn()">
<table id="tablescore"><tr><td>☆</td><td>☆</td><td>☆</td><td>☆</td><td>☆</td></tr></table>
</body>
</html>
谁能说说我代码的错误点在哪?
如果能讲明白的话,可以再加10分 展开
<title></title>
<script type="text/javascript">
function MouseIn() {
var tablescore = document.getElementById("tablescore");
var tds = tablescore.getElementsByTagName("td");
for (var i = 0; i < tds.lenth; i++) {
tds[i].onmouseover = tdOnMouseOver(tds, i);
tds[i].style.cursor = "pointer";
}
}
function tdOnMouseOver(tds, loc) {
for(var i = 0; i <= loc; i++) {
tds[i].innertext = "★";
}
for (i = loc; i < tds.lenth; i++) {
tds[i].innertext = "☆";
}
}
</script>
</head>
<body onload="MouseIn()">
<table id="tablescore"><tr><td>☆</td><td>☆</td><td>☆</td><td>☆</td><td>☆</td></tr></table>
</body>
</html>
谁能说说我代码的错误点在哪?
如果能讲明白的话,可以再加10分 展开
13个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询