87,993
社区成员
发帖
与我相关
我的任务
分享<!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>Test Page</title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<style type="text/css">
</style>
</head>
<body>
<input type="button" id="btn1" onclick="javascript:aaa();"/>
</body>
<script type="text/javascript" defer>
<!--
function GetPropertyString(element) {
var propStr = "";
var value;
for (var p in element) {
value = element[p];
if (value == "")
value = "STRING_EMPTY";
propStr += p + ": " + value + ";<br />";
}
return propStr;
}
document.write(GetPropertyString(document.getElementById("btn1")));
//-->
</script>
</html>
function GetPropertyString(element) {
var propStr = "";
for (var p in element) {
propStr += p + ": " + element[p] + "; ";
}
return propStr;
}
alert(GetPropertyString(document.getElementById("btn1")));