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