aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Disable/Enable inline style Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Disable/Enable inline style" Watch "Disable/Enable inline style" New topic
Author

Disable/Enable inline style

Reese Doherty
Greenhorn

Joined: Dec 07, 2006
Posts: 8
Hi,

Does anyone know of a way by which I could enable and disable an inline style based on a piece of javascript. I know its possible to do this woth stylesheets but I havent come across a way of doing it with inline styles. I have found a way to disable them by setting style.cssText to an empty string. However there is no way of enabling the style again as it has been removed.

Any help appreciated
Thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You would have to remove it than add it back on. You can set another property with the value before you remove it.

Eric
Reese Doherty
Greenhorn

Joined: Dec 07, 2006
Posts: 8
Would it be possible to remane the style by appending a caracter string and then searching for that string to remove it in order to reenable the style?
I'm not sure at all what functions/properties I can call on style.cssText. I have been able to rename the cssText but i dont know how to search it for the string I appended to it(in order to disable it)....
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Disable/Enable inline style