Set 64 Practical Question

⭐ Q14 – Image Disappears on Click (JavaScript)

Example Code (Read Only):


<!DOCTYPE html>
<html>
<head>
<title>Hide Image</title>

<script>
function hideImage(){
  document.getElementById("mypic").style.display = "none";
}
</script>

</head>
<body>

<h2>Click Image to Hide</h2>

<img src="pic.jpg" width="250" id="mypic" onclick="hideImage()">

</body>
</html>

Write Your HTML / JavaScript Code