求大侠:我下面的JavaScript代码哪里有错误??doit()和dosomething()以及selectit()不能执行,为什么啊?
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/l...
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>lesson8</title>
<script type="text/javascript">
function doit(){
alert("鼠标移除了图片");
}
function dosomething(){
alert("页面加载完成");
}
function selectit(){
alert(|"下拉菜单改变了选项");
}
</script>
</head>
<body onload="dosomething()">
<img src="123.jpg" height="150" width="200" onmouseout="doit()"></img>
<select onchange="selectit()">
<option value="0">男</option>
<option value="1">女</option>
<option value="2">不详</option>
</select>
<input type="text" name="usename" onfocus="alert('username获得了焦点')"></input>
</body>
</html> 展开
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>lesson8</title>
<script type="text/javascript">
function doit(){
alert("鼠标移除了图片");
}
function dosomething(){
alert("页面加载完成");
}
function selectit(){
alert(|"下拉菜单改变了选项");
}
</script>
</head>
<body onload="dosomething()">
<img src="123.jpg" height="150" width="200" onmouseout="doit()"></img>
<select onchange="selectit()">
<option value="0">男</option>
<option value="1">女</option>
<option value="2">不详</option>
</select>
<input type="text" name="usename" onfocus="alert('username获得了焦点')"></input>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询