How to Specify CSS for a JavaScript Piece?

Discussion in 'Javascript' started by bdwise, Nov 5, 2003.

  1. bdwise

    bdwise Guest

    I have a piece of mouseover javascript that is this
    .... "this.style.cssText='cursor:hand' ...

    But I want to specify a class in my stylesheeet instead. How do I do that?
     
    bdwise, Nov 5, 2003
    #1
    1. Advertisements

  2. (bdwise) writes:

    > I have a piece of mouseover javascript that is this
    > ... "this.style.cssText='cursor:hand' ...
    >
    > But I want to specify a class in my stylesheeet instead. How do I do that?


    Like this
    this.className='nameOfClass';
    ?

    /L
    --
    Lasse Reichstein Nielsen -
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
    'Faith without judgement merely degrades the spirit divine.'
     
    Lasse Reichstein Nielsen, Nov 5, 2003
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fernie
    Replies:
    6
    Views:
    43,563
    Michael Winter
    Nov 20, 2004
  2. Jim Van Abbema
    Replies:
    4
    Views:
    957
    mscir
    Dec 7, 2004
  3. Patrick Plattes

    Download a file piece by piece

    Patrick Plattes, Nov 30, 2006, in forum: Ruby
    Replies:
    2
    Views:
    372
    Patrick Plattes
    Nov 30, 2006
  4. Richard A. DeVenezia

    Can I use CSS to specify event handlers ?

    Richard A. DeVenezia, Sep 1, 2003, in forum: Javascript
    Replies:
    3
    Views:
    392
    David Dorward
    Sep 1, 2003
  5. Julie Siebel
    Replies:
    4
    Views:
    354
    Dr John Stockton
    Feb 25, 2004
  6. Eqbal
    Replies:
    8
    Views:
    193
    Michael Winter
    Oct 7, 2004
  7. sasperilla
    Replies:
    2
    Views:
    170
    sasperilla
    Feb 22, 2006
  8. Replies:
    7
    Views:
    396
Loading...