JQuery Find #ID, RemoveClass and AddClass
Posted
by Tom
on Stack Overflow
See other posts from Stack Overflow
or by Tom
Published on 2010-03-09T07:01:30Z
Indexed on
2010/03/09
7:06 UTC
Read the original article
Hit count: 500
Hi Guys,
I have the following HTML
<div id="testID" class="test1">
<img id="testID2" class="test2" alt="" src="some-image.gif" />
</div>
I basically want to get to #testID2 and replace .test2 class with .test3 class ?
I tried
jQuery('#testID2').find('.test2').replaceWith('.test3');
But this doesn't appear to work ?
Any ideas ?
© Stack Overflow or respective owner