This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using css classes in external javascript file?  RSS feed

 
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
Posts: 66205
151
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
Boost this thread!