image; ?>" class="card-img-top" alt="..." > Modified Code To remove img tag for image error add this code - onerror="$(this).remove()" <img src="&l"> image; ?>" class="card-img-top" alt="..." > Modified Code To remove img tag for image error add this code - onerror="$(this).remove()" <img src="&l">

how to remove img tag, if image is not displayed or available for webpage

अगर छवि प्रदर्शित नहीं है या वेबपेज के लिए उपलब्ध नहीं है तो img टैग को कैसे हटाएं

Current Code

<img src="<?php echo $metaData->image; ?>" class="card-img-top" alt="..." >

Modified Code

To remove img tag for image error add this code – onerror=”$(this).remove()”

<img src="<?php echo $metaData->image; ?>" class="card-img-top" alt="..." onerror="$(this).remove()" >


Leave a Reply