[jQuery] Prefixing all href attributes (or how to get .attr('href') to return a string)
I'm trying to use the below code to prefix all href's with 'cms/'...
[code]
$("#content_main a").attr('href', 'cms/' + $(this).attr('href'));
[/code]
I end up with href's which look like this "cms/undefined". I guess I
need to get $(this).attr('href') to return a string instead of a
JQuery object?
Many thanks, K.