This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using css classes in external javascript file?

 
Justin Fox
Ranch Hand
Posts: 802
  • 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: 64685
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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