Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > text style decoration in js

Reply
Thread Tools

text style decoration in js

 
 
mike
Guest
Posts: n/a
 
      11-01-2005
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

 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      11-01-2005
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
 
Reply With Quote
 
 
 
 
Danny
Guest
Posts: n/a
 
      11-01-2005


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
 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
A text decoration question Old HTML Slinger HTML 24 08-26-2006 02:13 PM
Style="text-decoration: line-through" Klaas ASP .Net 1 08-06-2006 01:10 PM
Style="text-decoration: line-through" Klaas ASP .Net Web Controls 1 08-06-2006 01:10 PM
Text decoration Desmond HTML 21 08-26-2004 04:09 PM
{text-decoration: none} Broken Paul Furman HTML 11 02-15-2004 11:18 PM



Advertisments