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
  • 679
  • 1
  • 10
  • 20

1 Answers1

1

You mean something like this

document.head.innerHTML+='<link rel="stylesheet" href="css/main.css">';
nicael
  • 17,612
  • 12
  • 55
  • 87