I want to find a match in the url, and then do something on that link, for example, change the color, etc.
$("a").filter("[href*='id=10']").css({color: 'red'});
HTML
<a href="http://website.come/folder/file.php?id=9&ajax=true">0</a> <a href="http://website.come/folder/file.php?id=10&ajax=true">1</a> <a href="http://website.come/folder/file.php?id=20&ajax=true">2</a> <a href="http://website.come/folder/file.php?id=30&ajax=true">3</a> <a href="http://website.come/folder/file.php?id=10&ajax=true">11</a>
But I have two matches in the list of links, and I just want the first match . What should I add to jquery code?
jsfiddle
source share