• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disable/Enable inline style

 
Reese Doherty
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic