L@_@K
<!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>
<div id="divP" class="">
<input type="text" id="i1" />
<select id="i2">
<option id="i201" value="" selected="selected"></option>
<option id="i202" value=""></option>
</select>
heiheihahei
<textarea id="i3" rows="" cols=""></textarea>
</div>
<script type="text/javascript">
<!--
var i1 = document.getElementById("i1");
var c = i1.parentNode.childNodes;
for (var p in c)
{
if (c[p].nodeType == 1)
{
alert(c[p].id);
}
}
//-->
</script>
</body>
</html>
送你三本手册!DHTML参考手册
http://download.csdn.net/source/308913样式表中文手册
http://download.csdn.net/source/304124JScript语言参考
http://download.csdn.net/source/308916
<!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>
<div id="divP" class="">
<input type="text" id="i1" />
<select id="i2">
<option id="i201" value="" selected="selected"></option>
<option id="i202" value=""></option>
</select>
heiheihahei
<textarea id="i3" rows="" cols=""></textarea>
</div>
<script type="text/javascript">
<!--
var i1 = document.getElementById("i1");
var c = i1.parentNode.childNodes;
for (var p in c)
{
if (c[p].nodeType == 1)
{
alert(c[p].id);
}
}
//-->
</script>
</body>
</html>
送你三本手册!DHTML参考手册
http://download.csdn.net/source/308913样式表中文手册
http://download.csdn.net/source/304124JScript语言参考
http://download.csdn.net/source/308916
解决方案 »
- js中读取session中的数组
- jquery选择器问题
- 帮我看看代码哪里有错误,谢谢
- JavaScript网址大全
- 关于JAVASCRIT显示值的问题!
- 网址复制给好友
- 如何在web客户端检测是否安装了某程序 ?
- 已知一个td,想知道该td在tr中的第几列,该怎么判断?
- 我的IE浏览器不执行javascript,怎么办?
- 提示callback is not a function是什么原因
- javascript中,设计一个类Class1,var aa = new Class1(),既有aa[6],又有aa['field3'],还有aa.property1,aa.property2,请问怎么设计这个类?
- 求一正则表达式
alert(parentNode.childNodes[i].id);
}
Retrieves a collection of HTML Elements and TextNode objects that are direct descendants of the specified object.