In article <m91kuv0337qhk4 m585n8tkcp2q6lg 3gb5d@4ax.com>, Geoff Cox
<geoffacox@dont spamblueyonder. co.uk> writes:
[color=blue]
>Is it possible to use javascript to swop between css files?[/color]
I found that by referencing the style sheet via a <link tag:
<link id="css_ref" type="text/css" href="styleshee t1.css" />
you can change its file reference using:
document.getEle mentById('css_r ef').href="new_ stylesheet.css"
This seems to work in MSIE 6 and NN7;
If you don't want to change an entire stylesheet, just the class, you can give
your element an id and change the class thusly:
<div id="redtext"
onMouseover="do cument.getEleme ntById(this.id) .className='new classname' " >
The class name changer appears to work for MSIE6 and NN7.
In article <20031224181850 .15599.00001702 @mb-m03.aol.com>, jimmenees@aol.c omNoSpam (JimMenees) writes:
[color=blue]
>If you don't want to change an entire stylesheet, just the class, you can
>give
>your element an id and change the class thusly:
><div id="redtext"
>onMouseover="d ocument.getElem entById(this.id ).className='ne wclassname' " >
>
>The class name changer appears to work for MSIE6 and NN7.[/color]
On 25 Dec 2003 00:24:48 GMT, hikksnotathome@ aol.com (HikksNotAtHome )
wrote:
[color=blue]
>In article <20031224181850 .15599.00001702 @mb-m03.aol.com>,
>jimmenees@aol. comNoSpam (JimMenees) writes:
>[color=green]
>>If you don't want to change an entire stylesheet, just the class, you can
>>give
>>your element an id and change the class thusly:
>><div id="redtext"
>>onMouseover=" document.getEle mentById(this.i d).className='n ewclassname' " >
>>
>>The class name changer appears to work for MSIE6 and NN7.[/color]
>
>That can be simplified to:
>
><div id="redtext" onMouseover="th is.className='n ewclassname' " >[/color]
Comment