Simple jQuery code snippet to use jQuery selector to get all those href’s based on a wildcard search. I was just writing a jQuery selector to extract hyperlinks based on wildcard matches and thought I would share it on the blog.
//output all links on page that start with "http://www.jquery4u.com"
$('#j4u-post a[href^="http://www.jquery4u.com"]').each(function (i,v)
Now to add a wildcard into our selector we can do this:
$('#j4u-post a[href*="jquery4u.com"]').each(function (i,v)
Using the *= essentially means “like” and the ^= means starts with. Thats it.