About
Pricing
Community
Teams
Start Free Trial
Log in
Jacko_Pinto
asked on
10/3/2012
Define a class in JS file
Can I add (define) a class inside a JS file? I don't have access to the CSS file of this particular site so I'm wondering if I can do it from the java script file to which I do have access. Complete newbie here, thanks for the comments.
JavaScript
Java
CSS
5
2
Last Comment
Kyle Hamilton
8/22/2022 - Mon
SOLUTION
Kyle Hamilton
10/3/2012
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Hagay Mandel
10/3/2012
I guess that if you can insert javascript to the page, you can add style tags with the desired class(es), not to mention to link to a new CSS file.
Kyle Hamilton
10/3/2012
my understanding was you can only edit an existing javascript file, not the document?
(just don't put the script tags inside the js).
Chris Stanyon
10/3/2012
If you can edit the javascript file, simply use it to write a new <link> in the head pointing to the url for a stylesheet of your choice :)
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER CERTIFIED SOLUTION
Kyle Hamilton
10/3/2012
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.