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);
This post is available on GitHub.
Posted .

Comments

Leave a Reply