javascript - jQuery div removeClass() / addClass() -


i have particular div element "testdiv" class;

<div class="testdiv">content</div> 

now using jquery want remove testdiv class , add different class;

jquery('div').removeclass('testdiv'); 

now how can add class particular div got class remove, fear if jquery('div').addclass('newclass'); add class other divs present in page.

how about:

jquery('div.testdiv').addclass('newclass').removeclass('testdiv'); 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -