kymbrik
10/14/2017 - 12:16 PM

Include css using VanillaJS dynamically

function addCss(fileName) {
    var head = document.head
        , link = document.createElement('link')
 
    link.type = 'text/css'
    link.rel = 'stylesheet'
    link.href = fileName
 
    head.appendChild(link)
}
 
addCss('/wp-content/themes/barletta/backgroundTmp.css');