How to query attribute values using wildcards

I'm creating a web site that conforms to xhtml 1.1, which excludes the use of the "target" attribute. Instead I'm using rel="external" and the attached jQuery script to open links in new windows.

The script works well, with the exceptions where I also use the "rel" attribute to tag content with the XFN micro format, i.e: rel="external me". In this case the attached script won't match the attribute, since it's not an exact match.

Is there a way in jQuery where I can match attribute values with a wildcard?

The site in question: http://www.fjæ
$(document).ready( function() {
    $('A[rel="external"]').click( function() { $(this).attr('href') );
        return false;

Open in new window

Who is Participating?
Michel PlungjanConnect With a Mentor IT ExpertCommented:
something like


havard-fjaerAuthor Commented:
Worked perfectly!
Thank you!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.