tags:

views:

56

answers:

1

Hi,

I'm new to Drupal and have been looking for a way (function or template method) to add a custom class(html attribute) to ALL anchor elements of the drupal site. I want to manipulate the anchors with jquery and need to be able to remove this class later on.

Thanks

A: 

If it's all anchor elements you want to class and you're using jQuery, is it feasible to do it purely within JavaScript at DOM-ready time?

$(document).ready( function() {
    $("a").addClass('myClass');
} );

Or even just

$(document).ready( function() {
    $("a").doWhatever();
} );

without applying the class?

kurreltheraven
Thanks for the reply. I was planning to do the above, but I needed to first be able to remove the custom class with JQuery to get around some IE issues. That would have involved some browser sniffing and I think I might go in a different direction now as it occurred that this might not be the best approach. Thanks in any case
JDK