text-decoration

C

chandy

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
 
I

impaler

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top