How do I add classes to an img tag inside the node? I want to add classes to the image that is getting displayed only inside the node. I want to do it in the Drupal way.

Here is the img tag HTML.

&lt;img typeof="foaf:Image" src="../image/imagefield_98F1iQ.png" width="220" height="78" alt="Capto cui esca" title="Damnum duis eum"&gt;


I want to add the classes like the below

&lt;img class="medium img-polaroid" typeof="foaf:Image" src="../image/imagefield_98F1iQ.png" width="220" height="78" alt="Capto cui esca" title="Damnum duis eum"&gt;


I just want to add "medium img-polaroid" like class to the img field.
you could preprocess the content in the template, but it would be a little difficult, or you could do it via attachBehaviors in jQuery.

If you mind the jQuery way you can add this script:

(function($) {
  Drupal.behaviors.classadd = {
    attach: function(){
      $('.node img').addClass('class1 class2 class3');
    }
  }
}


This way you can easily add classes to your node with .node class. even when you load content dinamicly via ajax. the attachBehavior is a useful Drupal technic to attach actions to your content, and it's widely implemented in all the Drupal framework.