函数直接量.<script>
function FormatShow()
{
this.formatblock = {
"Heading 1": "h1",
"Heading 2": "h2",
"Heading 3": "h3",
"Heading 4": "h4",
"Heading 5": "h5",
"Heading 6": "h6",
"Normal": "p",
"Address": "address",
"Formatted": "pre"
};
}
//实例化.
var test1 = new FormatShow();
//访问取值.
alert(test1.formatblock["Heading 1"]);
</script>
function FormatShow()
{
this.formatblock = {
"Heading 1": "h1",
"Heading 2": "h2",
"Heading 3": "h3",
"Heading 4": "h4",
"Heading 5": "h5",
"Heading 6": "h6",
"Normal": "p",
"Address": "address",
"Formatted": "pre"
};
}
//实例化.
var test1 = new FormatShow();
//访问取值.
alert(test1.formatblock["Heading 1"]);
</script>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货