Hi folks
I've got an anchor tag with a specific URL to which I want to add a class. I'm currently doing this as follows:
$('a[href=http://this.ismyurl.com/folder/file.html]').addClass('red');
The problem I have is that this URL is not consistent. The filename, file.html
is always the same, so if I could manipulate this string and focus on the last 9 characters (for instance) then I could add a class in the same way. The problem is, I'm not sure how to do this.
Can anyone help?
Thanks
Ronnie