Simple HTML Game: Click to Reveal Hidden Image
<html>
<head>
<title>My Simple HTML Game</title>
</head>
<body>
<h1>Let's Play a Game!</h1>
<p>Click on the box below to reveal a hidden image!</p>
<div id='box' onclick='revealImage()'>Click Here!</div>
<img id='hiddenImage' style='display:none;' src='image.jpg'>
<script>
function revealImage() {
document.getElementById('hiddenImage').style.display = 'block';
document.getElementById('box').style.display = 'none';
}
</script>
</body>
</html>
<p>How to play:</p>
<ol>
<li>Click on the box below the header to reveal a hidden image.</li>
<li>Enjoy the image that is revealed.</li>
</ol>
原文地址: https://www.cveoy.top/t/topic/lmj2 著作权归作者所有。请勿转载和采集!