怎么获取dom对象的所有属性和方法
1个回答
展开全部
可以得到各种浏览器的DOM对象属性方法
<table id="table">
</table>
<script language="javascript">
function showObject(obj) {
var ms = []
for(var m in obj) ms.push(m)
ms.sort()
var html = ""
for (var i in ms) {
var m = ms[i]
html += m + ": " + obj[m] + "<br>/n"
}
html += "<br><br>"
document.write(html)
}
var o = document.getElementById("table")
showObject(o)
</script>
<table id="table">
</table>
<script language="javascript">
function showObject(obj) {
var ms = []
for(var m in obj) ms.push(m)
ms.sort()
var html = ""
for (var i in ms) {
var m = ms[i]
html += m + ": " + obj[m] + "<br>/n"
}
html += "<br><br>"
document.write(html)
}
var o = document.getElementById("table")
showObject(o)
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询