JavaScript脚本点击不同标题显示不同内容的问题,求助!
<script type="text/JavaScript" language="JavaScritp">function show(id){
var content=document.getElementById("content") ;
var spec=document.getElementById("spec");
var picture=document.getElementById("picture");
if (id=='content') {
content.style.display=='block';
spce.style.display=='none';
picture.style.display=='none';
}else {if (id=='spec') {
spec.style.display=='block';
content.style.display=='none';
picture.style.display=='none';
}else{
picture.style.display=='block';
content.style.display=='none';
spec.style.display=='none';
}
}
}
<table>
<tr>
<td height="15" align="left"><input type="button" value="描述" id="" onclick='show("content")'></td>
<td align="left"><input type="button" value="规格" id="" onclick='show("spec")'></td>
<td><input type="button" value="图片" id="" onclick='show("picture")'></td>
</tr>
</table>
<div id="content" style="display:block">{内容}</div>
<div id="spec" style="display:none">{规格}</div>
<div id="picture" style="display:none">{图片}</div>