Sale is live! Enjoy 70% Off! Use Credit/Debit Cards in India and PayPal outside of India for better experience!

Get all URLs that match a pattern using jQuery


Source Code:

<script>
$(document).ready(function() {
	var pattern = /^\/string/;
	jQuery("a").each(function () {
		var href = jQuery(this).attr("href");
		if (href != undefined && href.match(pattern)) {
			console.log(href);
		}
	})
});
</script>

Reviews and Comments