0

I have a requirement where I need to call the main css file using javascript into the header section. So basically instead of having the below line within the headers

<link rel="stylesheet" href="css/main.css">

How can I call it using javascript within the header tags?

Bekki
  • 719
  • 2
  • 12
  • 20

1 Answers1

1

You mean something like this

document.head.innerHTML+='<link rel="stylesheet" href="css/main.css">';
nicael
  • 18,550
  • 13
  • 57
  • 90