Home > Software engineering >  jquery ui spinner change style of one specific spinner
jquery ui spinner change style of one specific spinner

Time:09-09

I want to remove the ui-corner-tr and ui-corner-br classes from one specific spinner with an id of test and a class of testSpinner as an example.

I tried... and many combinations of classes with no luck.

$('.ui-spinner .testSpinner').removeClass('.ui-corner-tr');
$('#test').removeClass('.ui-corner-tr');

Any ideas?

CodePudding user response:

It can be an order issue: maybe the jqueryUI library loads after your code, nullifying it.

(I'm just guessing... You should provide more details).

CodePudding user response:

the removeClass method does not require CSS selector names, just class names.

$('.ui-spinner .testSpinner').removeClass('ui-corner-tr');
$('#test').removeClass('ui-corner-tr');

Reference: https://api.jquery.com/removeclass/

  • Related