fbpx

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

5
(1)

Hello Dear Friends aaj ham niche diye gaye question ko solve karenge iska simple code hai jise aap follow karke ise solve kar sakte hai

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


<html>
    <body>
       <img src="image.jpg" id="image" onclick="removeImage()">

       <script>
        function removeImage() {
        // get the image element
        var image = document.getElementById("image");
        // remove the image from the page
        image.parentNode.removeChild(image);
       }
      </script>
    </body>
</html>

Output:


Image par click karke jarur dekhen

Rakeshmgs

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 1

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