https://www.rakeshmgs.in/search/label/Template
https://www.rakeshmgs.in

RakeshMgs

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

Updated:

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


Another Method to solve this


<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

рдЗрд╕ html рдХोрдб рдоें рдЬाрд╡ाрд╕्рдХ्рд░िрдк्рдЯ рдХा рдЗрд╕्рддेрдоाрд▓ рдХिрдпा рдЧрдпा рд╣ै рдЬिрд╕рдоे рдПрдХ рдлंрдХ्рд╢рди рдмрдиाрдпा рдЧрдпा рд╣ै function(img) рдиाрдо рд╕े, рдЗрд╕рдоें рдЬाрд╡ाрд╕्рдХ्рд░िрдк्рдЯ рдХे рдЕрди्рджрд░ css рдЗрд╕्рддेрдоाрд▓ рдХिрдпा рдЧрдпा рд╣ै рдЬिрд╕े JavaScript DOM рдХрд╣рддे рд╣ै рдЗрд╕рдХा рдкूрд░ा рдиाрдо Document Object Model рд╣ोрддा рд╣ै।


рдЖрдкрдХो рдЖрд░्рдЯिрдХрд▓ рдХैрд╕ा рд▓рдЧा? рдЕрдкрдиी рд░ाрдп рдЕрд╡рд╢्рдп рджें
Please don't Add spam links,
if you want backlinks from my blog contact me on rakeshmgs.in@gmail.com

ЁЯФТ Secure Session Protected

Unauthorized Inspection Detected

Security protection active hai.
Is page ko continue karne ke liye Developer Tools band karein.

Kripya Inspect / Console / Sources / Network panel close karein.

Protected Content • Secure View Enabled