OT- javascript question removing style settings

Andy Pieters mailings at vlaamse-kern.com
Mon Oct 10 19:51:23 UTC 2005


> 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/

--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20051010/78fc9d1c/attachment-0001.sig>


More information about the fedora-list mailing list