Jump to content

HTML DOM..does it change css stylesheets?


Guest websupermaster
 Share

Recommended Posts

err.. I'm not really sure what you're asking. DOM is the Document Object Model, and each browser implements it's own version of the DOM. You can access various elements in the page through javascript via the DOM, that's what it's there for.So I'm not really sure what you're asking. The only time you really "use" the DOM is when you are writing javascript code to access various things on the page. The browser, in turn, uses the DOM when it is rendering the page.You can use the DOM Link object to access or change which stylesheets are applied to the page, or you can use the DOM Style object to change the styles that are applied to each element. You do all of these things through javascript.If that answers your question, cool, if not, be a little more specific with what you are trying to do.

Link to comment
Share on other sites

Guest websupermaster
err..  I'm not really sure what you're asking.  DOM is the Document Object Model, and each browser implements it's own version of the DOM.  You can access various elements in the page through javascript via the DOM, that's what it's there for.So I'm not really sure what you're asking.  The only time you really "use" the DOM is when you are writing javascript code to access various things on the page.  The browser, in turn, uses the DOM when it is rendering the page.You can use the DOM Link object to access or change which stylesheets are applied to the page, or you can use the DOM Style object to change the styles that are applied to each element.  You do all of these things through javascript.If that answers your question, cool, if not, be a little more specific with what you are trying to do.

If you try to change the "style" with javascript by using DOM... does it change the stylesheet?
Link to comment
Share on other sites

If you are updating some element's style, like this:el.style = "xxx";Then the answer is no, all of the other styles will still be the same. In fact, I don't even know if it's possible to flat-out remove the current style sheet, but I know you can add another one through javascript. I'm sure you can probably delete the specific stylesheet object from the DOM if that's what you want to do, but you would probably have to know the address of it or something like that in order to look it up.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...