JSFiddle - React, Tailwind, and code Playground
by ChrisStanyon
HTML
<p><a href="test1">Test 1</a></p>
<p><a href="test2">Test 2</a></p>
<p><a href="test3">Test 3</a></p>
<p><a href="test4">Test 4</a></p>
<p><a href="test5">Test 5</a></p>
<button id="click">Click Me</button>
JavaScript
$('#click').click(function(){
$('a').each(function(index, elem ) {
var href = $(this).attr('href');
if (href.indexOf("est4") != -1) {
//we have a match
alert("Woo Hoo");
};
})
})