查看对象属性

<html>
<body>
<script type="text/javascript">
var x
var mycars = new Array()
mycars[0] = "Saab"
mycars[1] = "Volvo"
mycars[2] = "BMW"

for (x in mycars)
{
document.write(mycars[x] + "<br />")
}
function a(){
 var s =	document.getElementById("x");
 for(mm in s){
	document.write(mm + "<br />")
 }
}
</script><TABLE>
<TR id="x">
	<TD></TD>
	<TD></TD>
</TR>
<TR>
	<TD><button onclick="a()" value="xx"> </TD>
	<TD></TD>
</TR>
</TABLE>
</body>
</html>

你可能感兴趣的:(对象)