jquery.RemoveClass - Removing class by not refering id

229 views Asked by At

enter image description here

I am looking for the quick fix for removing the class 'checked' in the lower most level. $('#bannerGeography tr td .allTR .option-group div.checkbox').RemoveClass('checked');

Did not seem to work. Can you please help

2

There are 2 answers

0
Tushar On BEST ANSWER

Use removeClass(Notice r) and not RemoveClass:

$('#bannerGeography tr td .allTR .option-group div.checkbox').removeClass('checked');
//                                                            ^

Docs: http://api.jquery.com/removeClass/

Remove a single class, multiple classes, or all classes from each element in the set of matched elements.

0
Balachandran On

use removeClass() instedad of RemoveClass()

$('#bannerGeography div.checkbox').removeClass('checked');

NOTE: In your DOM structure TR not having any children of .allTR so you have to use find() selector like above or use this $('#bannerGeography').find('div.checkbox').removeClass('checked');