Add css inline style using JavaScript

Add inline css style using JavaScript via document.createElement.

var style = document.createElement('style');
style.textContent = '.alert { color: red; };';
document.head.appendChild(style);
View this page on GitHub.
Posted .

Comments

Leave a Reply