Results 1 to 3 of 3
Thread: Condition and element.style...?
Aug 16, 2007, 23:49 #1
- Join Date
- Jan 2005
- 0 Post(s)
- 0 Thread(s)
Condition and element.style...?
i am trying to have text-decoration applied on some text depending on the value of certain variable. If the value of myvar=0 text-deco =none and if it's 1 then text deco= line-trough...
Kind of the same thing that emails web apps like yahoo or gmail do with mails read or unread if it's unread then email title/subject is bold/strong but if it's read then email title is in normal font-weight...
here is some piece of code i have written to do that
the text on which i want to apply the conditionnal decoration is a table cell (cell2DisplayCell1), the text itself is inserted by the innerHTML instruction!
I tried to introduce the conditional statement with a function displaylinksLineThrough() which is defined in the second block code...
cell2DisplayCell1.style.textDecoration = "displaylinksLineThrough(displayTitleDestbtn"+SmartLink.smartlinks_infos[sli].id_dest+", "+SmartLink.smartlinks_infos[sli].deleted+")" cell2DisplayCell1.innerHTML = (SmartLink.smartlinks_infos[sli].title_dest);