首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

JAVASCRIPT有关问题,

2012-05-21 
JAVASCRIPT问题求助,在线等!!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://ww

JAVASCRIPT问题求助,在线等!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function fn()
{var x=document.getElementsByTagName("input");
x[0].src="zhuce_text.jpg";
}
</script>
</head>

<body>
<form id="zck" onsubmit="fn()">
<input type="image" src="dzt.jpg">
</form>
</body>
</html>


本意是想:点击按钮后,按钮的图片改变
但是实际情况:没反应

[解决办法]

HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><script type="text/javascript">function fn(){var x=document.getElementsByTagName("input");x[0].src="http://avatar.profile.csdn.net/7/5/E/2_dazitou123.jpg";return false;}</script></head><body><form id="zck" onsubmit="return fn()"><input type="image" src="dzt.jpg"></form></body></html> 

热点排行