text style decoration in js

Discussion in 'Javascript' started by mike, Nov 1, 2005.

  1. mike

    mike Guest

    I am looking for the javascript equivalent of:

    style="text-decoration:underline;" in a span tag created dynamically.

    I was thinking it was:

    mySPAN.style.text-decoration="underline";

    but that should fail because "text-decoration" is not going to be
    recognized.

    Anyone know what it is?

    Mike
     
    mike, Nov 1, 2005
    #1
    1. Advertising

  2. mike wrote:

    > mySPAN.style.text-decoration="underline";
    >
    > but that should fail because "text-decoration" is not going to be
    > recognized.


    It fails because `-' is an operator in JS.

    > Anyone know what it is?


    mySPAN.style.textDecoration = "underline";

    It's a FAQ.


    PointedEars
     
    Thomas 'PointedEars' Lahn, Nov 1, 2005
    #2
    1. Advertising

  3. mike

    Danny Guest

    The rule goes, PREDASHWORD-POSTDASHWORD-ANDSOONSOON, will be in js,
    OBJ.style.predashwordPostdashwordAndsoonsoon, so, any letter after the
    dash, will be capitalized for the property name, with the rest lowercase.



    Danny
     
    Danny, Nov 1, 2005
    #3
    1. Advertising

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. Paul Furman

    {text-decoration: none} Broken

    Paul Furman, Feb 14, 2004, in forum: HTML
    Replies:
    11
    Views:
    786
    Mark Parnell
    Feb 15, 2004
  2. Desmond

    Text decoration

    Desmond, Aug 25, 2004, in forum: HTML
    Replies:
    21
    Views:
    1,002
  3. Klaas
    Replies:
    1
    Views:
    730
    Alessandro Zifiglio
    Aug 6, 2006
  4. Old HTML Slinger

    A text decoration question

    Old HTML Slinger, Aug 22, 2006, in forum: HTML
    Replies:
    24
    Views:
    2,666
    Jonathan N. Little
    Aug 26, 2006
  5. Klaas

    Style="text-decoration: line-through"

    Klaas, Aug 6, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    175
    Alessandro Zifiglio
    Aug 6, 2006
Loading...

Share This Page