tags:

views:

20

answers:

1

In below markup, i want to find tag and want to add a common class class "AAA" then after want to add rel="bbbb" in all tags.

My HTML Markup

 <div class="gallery galleryid-4" id="gallery-1">
            <dl class="gallery-item">
            <dt class="gallery-icon">
                <a title="54-Valentine-Wallpapers" href=""><img width="150" height="150" title="54-Valentine-Wallpapers" alt="54-Valentine-Wallpapers" class="attachment-thumbnail" src="http://linkspire.rtcamp.info/wp-content/uploads/2010/08/54-Valentine-Wallpapers-150x150.jpg"&gt;&lt;/a&gt;
            </dt></dl>
            <dl class="gallery-item">
            <dt class="gallery-icon">
                <a title="27320_car-wallpapers19" href=""><img width="150" height="150" title="27320_car-wallpapers19" alt="27320_car-wallpapers19" class="attachment-thumbnail" src="http://linkspire.rtcamp.info/wp-content/uploads/2010/08/27320_car-wallpapers19-150x150.jpg"&gt;&lt;/a&gt;
            </dt></dl>
            <dl class="gallery-item">
            <dt class="gallery-icon">
                <a title="bugatti-v16-turbo-wallpapers" href=""><img width="150" height="150" title="bugatti-v16-turbo-wallpapers" alt="bugatti-v16-turbo-wallpapers" class="attachment-thumbnail" src="http://linkspire.rtcamp.info/wp-content/uploads/2010/08/bugatti-v16-turbo-wallpapers-150x150.jpg"&gt;&lt;/a&gt;
            </dt>
            </dl>

    </div>

PS.

+1  A: 

A vague answer to your vague question

$('gallery-1 TAG-NAME-HERE').addClass('AAA');

$('gallery-1 *').attr('rel', 'BBB')
Andrew Bullock