你传的没错啊 ,但是 imgObj[i] 是在哪里定义的呢?
解决方案 »
- 急:js给表单对象添加表单域的方法
- DIV和image的优先级?
- javascript 怎样判断web控件输入的字符长度
- 请问为生成INPUT添加事件怎么没能成功?
- 使用者按了 PageDown 键会自动连到某个连结,怎么做﹖
- 一直没有系统的学过JS,想找本书看看........谢谢大家...呵呵.......
- 如何实现三个栏目的定时跳转
- JS的encode是用什么加密的,又怎么解密?
- 我想将弹出窗口显示在母窗口的正中间,就是不知如何取母窗口左上角的绝对坐标
- 怎么改变网页自身的大小
- 一个关于onclick事件的问题 ,我做梦都在想 请高手帮忙治疗一下吧!
- 一种定义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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="Gao YiXiang" />
<meta name="email" content="[email protected]" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
</head>
<body>
<input type="text" id="" value="1" />
<input type="text" id="" value="2" />
<input type="text" id="" value="3" />
<script type="text/javascript">
<!--
var txtArr = document.getElementsByTagName("input");
for (var i=0; i<txtArr.length; i++)
{
txtArr[i].onclick = function()
{
if (txtArr[i].type == "text")
{
showValue(txtArr[i]);
}
};
}
function showValue(oTarget)
{
alert(oTarget.value);
} //-->
</script>
</body>
</html>
这是正确滴演示!
<!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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="Gao YiXiang" />
<meta name="email" content="[email protected]" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
</head>
<body>
<input type="text" id="" value="1" />
<input type="text" id="" value="2" />
<input type="text" id="" value="3" />
<script type="text/javascript">
<!--
var txtArr = document.getElementsByTagName("input");
for (var i=0; i<txtArr.length; i++)
{
txtArr[i].onclick = function()
{
if (this.type == "text")
{
showValue(this);
}
};
}
function showValue(oTarget)
{
alert(oTarget.value);
} //-->
</script>
</body>
</html>
imgArr[i].obj = imgObj[i];imgArr[i].onreadystatechange=function(){
if(this.readyState=="complete"){
imgLoad(this.obj,this);
}
}