I am trying to apply the style dynamically to several drop-down lists on my page. Using jQuery addClass really adds a class to all the Select elements, as I can see it on my Chrome console. However, styles do not apply to elements.
Now, if I manually add a class to each selection item separately, and then save the page and refresh it, the style applies to the item.
Any idea why the style doesn't apply when injecting a jquery class?
$("select").addClass("select js-select");
source
share