JavaScript 如何遍历得到控件的所有属性? 困惑了好长时间的问题!!!! 分不够说话. for(var s in window){ alert('window.'+s+' = '+window[s]);} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <span a=1 b=2 c=3 onclick="test(this)">点击查看我的属性集</span><br><br><div id=result></div><script>function test( the ){ var str = "" ; for( var i = 0 ; i < the.attributes.length ; i++ ) { str += "nodeName:" + the.attributes[ i ].nodeName + "<br>" ; str += "nodeType:" + the.attributes[ i ].nodeType + "<br>" ; str += "nodeValue:" + the.attributes[ i ].nodeValue + "<br>" ; str += "name:" + the.attributes[ i ].name + "<br>" ; str += "specified:" + the.attributes[ i ].specified + "<br>" ; str += "expando:" + the.attributes[ i ].expando + "<br>" ; str += "<br>---------------<br>" } result.innerHTML = str}</script> 还是调用json数据的问题? 求一个关于html标签的正则表达式正则表达式 请问Ajax怎么获析数据 谁有JavaScript生成的Tree的例子啊? extjs 中的combobox不显示下拉的值啊,有时候又显示。 如何在一个JS树点击后使另一个框架内页面跳转,并且动态生成这个树此节点的信息?? 新手请教一下怎么把第一项默认打开 求一递归函数! 如何将字符串的首尾空格去掉??? 图片地址想改成绝对引用的,但是改不成功 如何用JS更改文档中所有DIV元素的CSS CLASS? 关于onchange的问题,急求解决。
<br>
<br>
<div id=result></div>
<script>
function test( the )
{
var str = "" ;
for( var i = 0 ; i < the.attributes.length ; i++ )
{
str += "nodeName:" + the.attributes[ i ].nodeName + "<br>" ;
str += "nodeType:" + the.attributes[ i ].nodeType + "<br>" ;
str += "nodeValue:" + the.attributes[ i ].nodeValue + "<br>" ;
str += "name:" + the.attributes[ i ].name + "<br>" ;
str += "specified:" + the.attributes[ i ].specified + "<br>" ;
str += "expando:" + the.attributes[ i ].expando + "<br>" ;
str += "<br>---------------<br>"
}
result.innerHTML = str
}
</script>