Can you do this.style.text-decoration?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
MattSharp
Forum Commoner
Posts: 62
Joined: Wed Apr 24, 2002 2:25 pm

Can you do this.style.text-decoration?

Post by MattSharp »

I tried this and it just keeps giving me ; expecting errors? IS this even possible?
nahp
Forum Newbie
Posts: 7
Joined: Mon Apr 22, 2002 3:24 am

Post by nahp »

when you want to access a css property from javascript you have to replace the hyphen from the property name by an uppercase letter:

text-decoration : textDecoration
background-color: backgroundColor
...

it s just because hyphen ain t a valid character for variable names
User avatar
sam
Forum Contributor
Posts: 217
Joined: Thu Apr 18, 2002 11:11 pm
Location: Northern California
Contact:

Post by sam »

You would do that something like this:

Code: Select all

this.style="text-decoration: strike;"
Cheers Moe
margueratesullivan
Forum Newbie
Posts: 1
Joined: Mon Apr 20, 2009 4:17 am

Re: Can you do this.style.text-decoration?

Post by margueratesullivan »

What kind of knot can I use to tie a garden decoration to a 7 ft tall metal framed arch?
I cant reach the top with a ladder. So, could I throw a piece of twin over the arch, tie the dangling chime and do some sort of knot that would tight, pulling the decoration up so that it's not dangling to low? I was thinking of a slip knot.
___________________
external keyword tool ~ keyworddiscovery.com ~ keycompete.com ~ compete.com ~ webmasterworld.com
Post Reply