I’m using gwtquery to manipulate the pages, i found in jQuery i can use:
$('body').removeClass().addClass(myClass);
But seem gwtquery does not provide the same removeClass() method, it only has removeClass(String... classes). It is not quite useful if i want to remove all classes of the Element without knowing the names beforehands.
Anybody who know the counterpart of this method?
Short answer:
Use
setClassName("")on GWT’s element class$('gwt-Label').widgets().get(0).getElement().setClassName("")Or, set the
classNameattribute directly$("gwt-Label").attr("className","")Long answer:
So, I looked through the two implementations, and they seem to do two different things.
classNameproperty of the dom element if there are no classes to remove.classNameproperty.