text style decoration in js

M

mike

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
 
T

Thomas 'PointedEars' Lahn

mike said:
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
 
D

Danny

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
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top