• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using css classes in external javascript file?

 
Justin Fox
Ranch Hand
Posts: 802
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would I use an external .css class in my external .js file?

Thanks,

Justin Fox
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once a JavaScript file is loaded, there is no difference between whether the script was on-page or in an external file. So your script can reference any CSS class just as if it were defined on-page.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic