Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > text-decoration

Reply
Thread Tools

text-decoration

 
 
chandy@totalise.co.uk
Guest
Posts: n/a
 
      01-31-2006
Hi,

I am trying to access the text-decoration property for an element's
style.

I know that this works:

Object.style.color = 'blue';

but this doesn't:

Object.style.text-decoration='line-through';

The 2nd appears to choke on the hyphen in text-decoration?

Is this the problem? How else can I access text-decoration for the
style?

Chandy

 
Reply With Quote
 
 
 
 
chandy@totalise.co.uk
Guest
Posts: n/a
 
      01-31-2006
Nevermind, found it:

Object.style.textDecoration='line-through';

 
Reply With Quote
 
 
 
 
impaler
Guest
Posts: n/a
 
      01-31-2006

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Nevermind, found it:
>
> Object.style.textDecoration='line-through';


Just a short notice:
when the property consists of 2 or more words and are separated by "-"
you obtain the respective property by taking out the "-" and capitalize
the next word.

ex: border-width -> borderWidth

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments