I am having trouble applying a style that is !important
. I’ve tried:
$(\"#elem\").css(\"width\", \"100px
const elem = $("#elem");
elem[0].style.removeAttribute('width');
elem[0].style.setProperty('width', '100px', 'important');
Note: Using Chrome may return an error such as:
elem[0].style.removeAttribute is not a function
Changing the line to use the .removeProperty
function such as to elem[0].style.removeProperty('width');
fixed the issue.