Re: OT- javascript question removing style settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> This would work, but you'd still be overriding the stylesheet, not clearing
> the style property of the element.
>
You can set the color property to "inherit" and with a little cascade 
construction get the effect you want

span.style1 {color: blue; }

<span id="myspan" class="style1">blue</span>

In you javascript

document.getElementById('myspan').style.color='red'; //change to red

document.getElementById('myspan').style.color='inherit'; //back to blue


HTH



Andy


-- 
Registered Linux User Number 379093
Now listening to Green Day - She

   amaroK::the Coolest Media Player in the known Universe!


   Cockroaches and socialites are the only things that can 
   stay up all night and eat anything.
					    Herb Caen
--
-- --BEGIN GEEK CODE BLOCK-----
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C++++$(+++) UL++++>++++$ P-(+)>++
L+++>++++$ E---(-)@ W+++>+++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e>++++$@ h++(*) r-->++ y--()>++++
-- ---END GEEK CODE BLOCK------
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/

--

Attachment: pgpapa0hReAEE.pgp
Description: PGP signature


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux