我正在尝试制作一个 JavaScript 可见性功能,当我按下它出现的图像按钮时。图像没有出现。我隐藏了图像,因为我只希望它们在按下按钮时显示。我该怎么做才能解决这个问题?
<html>
<head>
<style type="text/css">
#xbone {
position:absolute;
margin-left: auto;
margin-right: auto;
visibility: hidden;
}
#ps4 {
position:absolute;
margin-left: auto;
margin-right: auto;
visibility: hidden;
}
#wiiu {
position:absolute;
margin-left: auto;
margin-right: auto;
visibility: hidden;
}
</style>
<script type="text/javascript">
function xbox()
{
document.getElementById("xbone").style.visibility="visible";
}
funtion sony()
{
document.getElementById("xps4").style.visibility="visible";
}
funtion nintentdo()
{
ddocument.getElementById("wiiu").style.visibility="visible";
}
</script>
<img id="xbone" src="http://assets1.ignimgs.com/vid/thumbnails/user/2013/06/19/XboxOne1.jpg" alt="Xbox One" width="800" height="600">
<img id="ps4" src="http://gamingbolt.com/wp-content/uploads/2013/06/ps4-hd-wallpapers.jpg" alt="Playstation 4" width="800" height="600">
<img id="wiiu" src="http://www.digitaltrends.com/wp-content/uploads/2012/09/Wii-U.jpg" alt="Wii U" width="800" height="600">
<input type="button" value="XBox One" onclick="xbox()">
<input type="button" value="Playstation 4" onclick="sony()">
<input type="button" value="WII U" onclick="nintendo()">
</head>
<body>
</body>
</html>