我想显示对象 Wine1 的所有属性及其各自的值。但是这段代码不起作用:
<html>
<head>
</head>
<body>
<input type="button" value="Button" onClick="f1()">
<script type="text/javascript">
function f1()
{
var Wine1=new Object();
Wine1.color="Red";
Wine1.price="50000 USD";
Wine1.vine-yard="South";
var record="Wine1<br><br>";
for(var prop in Wine1)
{
record+=prop+"="+Wine1[prop]+"<BR>";
}
record+="<br>";
document.write(record);
}
</script>
</body>
</html>
有人请帮我找出错误。