View Single Post
  #3 (permalink)  
Old Nov 23rd, 2006, 03:57
mar2195 mar2195 is offline
New Member
Join Date: Nov 2006
Location: MD
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Possible to detect which stylesheet in use?

Quote:
Code: Select all
<link rel="stylesheet" type="text/css" href="layout.css" id="style" />

alert(document.getElementById("style").getAttribute("href"));
Unfortunately, I am working on a web page that I am being "fed" that I have no control over. The <LINK> tag does not have an "id" and I cannot add an "id" to the <LINK> tag.

I am only able to manipulate/edit the page within the <BODY> section.

So... I need to DETECT which Stylesheet is specifically being used within the <LINK> tag without an "id".

There are a few different stylesheets that are being used. I need to know which stylesheet is the CURRENT one so that I can counter-code (if that's a real word ) specific font colors, background colors, etc.

If you need futher explanation, I'll be happy to give deeper descriptions. But I think that I've covered the situation.


Thanks.
Reply With Quote