This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring 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: 64613
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