1

I have the following css rules defined in my <style>...</style> section:

<style>
    div[class*=col-] {border-right: 1px solid #ccc; border-bottom:1px solid #ccc;}
    div[class*=col-]:first-child {border-left: 1px solid #ccc; border-top:1px solid #ccc;}
</style>

How can add these rules to the page at runtime using JavaScript only (no jquery).

AngryHacker
  • 56,860
  • 95
  • 305
  • 561
  • create a style element (`document.createElement`), add the content to this element, add the element to the DOM (`document.head.appendChild`) – Jaromanda X Jul 04 '17 at 03:50

0 Answers0