0

I need to link an external CSS file into a JavaScript file i am working on.

Obviously to link one into HTML you would use:

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

But what is the JavaScript equivalent?

j08691
  • 204,283
  • 31
  • 260
  • 272
  • 3
    There's no actual equivalent - JavaScript can't be styled. What do you mean when you say you need to "link" the CSS to a JavaScript file? What do you want to *do* with that link? – Paul Roub Apr 21 '14 at 21:11
  • Basically i'm doing some map markers on a site and you have to style them individually, i was wondering if there was a quick way to link to a css file and do it that way. – user3558049 Apr 21 '14 at 21:19
  • 1
    You link the css using the `` element or dynamically in the "how to upload css files..." link someone gave you above. The css is loaded and interpreted by the browser and doesn't have any link with your js. The map markers can't be styled until loaded to the dom. – scrappedcola Apr 21 '14 at 21:22

0 Answers0