var style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = '.cssClass { color: #F00; }'; document.getElementsByTagName('head')[0].appendChild(style); document.getElementById('someElementId').className = 'cssClass';
create CSS class in JavaScript
Labels:
css,
JavaScript
0 komentar:
Posting Komentar