Q:

Fix broken images automatically. Hide the following broken img tag in the body section using jquery

0

  using jquery Fix broken images automatically.
Hide the following broken img tag in the body section.

Sample Data :

<body>
<a href="https://www.w3resource.com"><img src="//www.w3resource.com/image/w3resourcelogo.gif" alt="w3resource logo" width="150" height="78" /></a> </body>

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
  <meta charset="utf-8">
  <title>Fix broken images automatically</title>
</head>
<body>
<a href="https://www.w3resource.com/images/w3resource-logo.png" alt="w3resource logo" width="150" height="78" onerror='$(this).hide();'/></a>
</body>
</html>

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now