Jacko_Pinto
asked on
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.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
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.
my understanding was you can only edit an existing javascript file, not the document?
(just don't put the script tags inside the js).
(just don't put the script tags inside the js).
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 :)
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.