Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Changing the Class of an element


Message #1 by Terrence Joubert <Terrence@v...> on Thu, 8 Nov 2001 11:36:00 +0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C16829.84A632B0
Content-Type: text/plain

Thanks Robert,
Everything works perfectly now.
Terry

-----Original Message-----
From: Nyman, Robert [mailto:Robert.Nyman@i...] 
Sent: Thursday, November 08, 2001 11:58 AM
To: JavaScript HowTo
Subject: [javascript_howto] RE: Changing the Class of an element


It should be this.className...
 
 
/Robert
 
 

-----Original Message-----
From: Terrence Joubert [mailto:Terrence@v...] 
Sent: den 8 november 2001 08:36
To: JavaScript HowTo
Subject: [javascript_howto] Changing the Class of an element




Hi Folks, 

I have a Stylesheet(*.css) containing classes for button elements. Both
'pagebutton' and 'pagebuttonon' classes are specified in the stylesheet.

Upon loading the page, the class for a button is 'pagebutton' . When the
button is clicked, I want it to have the class 'pagebuttonon', so I use this
code:

<input type="button" name="btn" value="button"  class="pagebutton" onClick="
return this.class = 'pagebuttonon';"> 

I receive the JavaScript error that the class attribute does not exist for
the button btn. 
Can someone please help? 

Many thanks 
Terry 

$subst('Email.Unsub')


$subst('Email.Unsub')




  Return to Index