为什么用 document.getElementById("type1").value=abc[0];
document.getElementById("date1").value=abc[1];
不能给 <input type="text" name="type" id="type1" />
<input type="text" name="date" id="date1" />
传值啊!求指教啊!
<!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=utf-8" />
<title>Borser Detection</title>
<script type="text/javascript">
function abc(){
var s=["",""];
s[1]="123";
s[0]="11123";
return s;
}
function bcd(){
var abc=abc();
document.getElementById("type1").value=abc[0];
document.getElementById("date1").value=abc[1];
}
</script>
</head>
<body onload="bcd()">
<input type="text" name="type" id="type1" /> <input type="text" name="date" id="date1" />
</body>
</html>
document.getElementById("date1").value=abc[1];
不能给 <input type="text" name="type" id="type1" />
<input type="text" name="date" id="date1" />
传值啊!求指教啊!
<!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=utf-8" />
<title>Borser Detection</title>
<script type="text/javascript">
function abc(){
var s=["",""];
s[1]="123";
s[0]="11123";
return s;
}
function bcd(){
var abc=abc();
document.getElementById("type1").value=abc[0];
document.getElementById("date1").value=abc[1];
}
</script>
</head>
<body onload="bcd()">
<input type="text" name="type" id="type1" /> <input type="text" name="date" id="date1" />
</body>
</html>
解决方案 »
- js中有没有像C#中Guid()的方法?
- 关于onMouseOver、onMouseOut、onClick 实现一个效果
- 帮忙看下这网站图片显示效果,哪位大侠能把里面的JS扒出来,谢谢
- 谁来帮忙注释下每句Javascript代码的意思。
- script代码修改
- MzTreeView2.0如何将选中复选框checkbox的值提取出来?反之根据值选中复选框?
- 关于前台处理后台返回的json数据以及php的问题
- FF下怎样调用远程XML文件
- javascript 操作 cookie问题,高人请进
- 关于fileupload中的value问题
- 小女刚学js.迷茫中。。。求大牛赐教。。。题目越长越好,越长越好,越长越好,越长越好,越长越好,越长越好,越长越好,越长越好,越长越好,越长越好,越长越好。。。
- 学习DTREE 遇到的一点疑问
明显是变量和函数重名了
<script type="text/javascript">
function bcd(){
var a=abc();
document.getElementById("type1").value=a[0];
document.getElementById("date1").value=a[1];
}
function abc(){
var s=[];
s[1]="123";
s[0]="11123";
return s;
}
</script>
<body onload="bcd()">
<input type="text" name="type" id="type1" />
<input type="text" name="date" id="date1" />
</body>