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> 跪求大家赐教啊 AJAX调用慢 JS执行未获得AJAX返回参数问题 (我没分看下行吗谢谢大家) 想讨论一下JS模拟加速的算法 js伸缩菜单问题 后台下载图片替换问题 如何获取网站浏览者的IP地址等信息?高手请出手帮忙 onclick 问题 如何退出自定义的JavaScript函数!!??? 怎样判断文本框中输入的是123.45形式 请问字体为Webdings的Button如何显示文字居中? 用javascript如何取得本网页的url? 如何用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>