看看下面的Javascript代码错在哪里

来源:百度知道 编辑:UC知道 时间:2024/05/16 10:04:50
求助 检查下面的代码错在哪里
悬赏分:5 - 离问题结束还有 11 天 21 小时
<html>
<head>
<style type="text/css">
.koo{

background:blue url
}
.foo{

background:red
}
.boo{

background:yellow
}
</style>

</head>
<body>
<script type="text/javascript">
function bbc(){ var d=document.getElementById("ddp");
x=d.getElementsByTagName("input")
var obj
for(i=0; i<x.length; i++){x[i].onkeyup=getfoc;}//请检查这里
document.write(x[1].name)
}

function getblu(obj)
{obj.className="boo";}
function getfoc(obj){obj.className="foo"; }
function getkej(obj)
{ obj.className="koo"; }
</script>

<form id="ddp">
<input name="myInput" type="text" size="20" id="df&q

<html>
<head>
<style type="text/css">
.koo{

background:blue;
/*
这里有改用,之前是:
background:blue url
*/
}
.foo{

background:red
}
.boo{

background:yellow
}
</style>

</head>
<body>
<script type="text/javascript">
function bbc(){ var d=document.getElementById("ddp");
x=d.getElementsByTagName("input")
var obj
/*下面有改动:*/
for(i=0; i<x.length; i++){x[i].onkeyup=function(){getfoc(this);}}//请检查这里
document.write(x[1].name)
}

function getblu(obj)
{obj.className="boo";}
function getfoc(obj){obj.className="foo"; }
function getkej(obj)
{ obj.className="koo"; }
</script>

<form id="ddp">
<input name="myInput" type="text&qu