JSFiddle - React, Tailwind, and code Playground

by vicky081

HTML

<a href="https://www.google.com/images/srpr/logo4w.png">Google</a>

JavaScript

$(document).ready(function() {

                $("a").each(function(i, el) {
                    var href_value = el.href;
                    if (/\.(jpg|png|gif)$/.test(href_value)) {
                        alert(href_value);
                    } else {
                        alert('it is not the image');
                    }
                });

            });