fbpx

Design a HTML page to display a picture. The picture should be removed from the screen after a mouse click on the picture. – RakeshMgs

0
(0)

Question: Design a HTML page to display a picture. The picture should be removed from the screen after a mouse click on the picture.

Output Preview
 
  <!DOCTYPE html>
  <html>
  <head>
  <title>WD 9.2 (xi)</title>
  </head>
  <body>
  <div id=”im“><img src=”image/1.png” style=”cursor: pointer;” /></div>
  <script type=”text/javascript“>
  document.getElementById(“im”).onclick = function(img) {
  img.target.style.visibility = ‘hidden’;
  }
  </script>
  </body>
  </html>
 
 



Output


Rakeshmgs

इस html कोड में जावास्क्रिप्ट का इस्तेमाल किया गया है जिसमे एक फंक्शन बनाया गया है function(img) नाम से, इसमें जावास्क्रिप्ट के अन्दर css इस्तेमाल किया गया है जिसे JavaScript DOM कहते है इसका पूरा नाम Document Object Model होता है।

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Leave a Reply