I tried to inject a style using this code:
document.body.style.color=\'green!important\';
Per the CSS cascade ref, by applying the !i
!i
all answers are great but they all assumed the value of the attribute is fixed,, what if not
value
fixed
take look at my solution
this.style.setProperty("color", $(this).css('color'), "important");
instead of hand writing the value, I got it using jquery $(this).css('attr')
hand writing
$(this).css('attr')