|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (10 bit)
|
TD & innerText
I am using javascript to dynamically change the text in a TD. The problem I am having is I need to make parts of the innerText bold and this doesn't seem to be working well.
When the javascript changes the text in the TD it displays the < b > and < / b > tags instead of interpreting them as html. Is there a way to force this to understand html tags when changing innertext? Thanks for any help. |
|
|
|
|
|
#2 |
|
Barefoot on the Moon!
Staff
Premium Member
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
|
Could you post what you have so far?
__________________
There are two secrets to staying young, being happy, and achieving success. You have to laugh and find humor every day, and you have to have a dream.
|
|
|
|
|
|
#3 |
|
Member (10 bit)
|
< td id='TestTD' >
< script language=' javascript ' > function changeTD(tdName){ tdName.innerText = 'Test' } < /script > |
|
|
|
|
|
#4 |
|
Barefoot on the Moon!
Staff
Premium Member
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
|
PHP Code:
If "Test" is just text and not a variable, try this: PHP Code:
Last edited by Force Flow; 07-28-2004 at 08:00 AM. |
|
|
|
|
|
#5 |
|
Member (10 bit)
|
It is a variable. thanks for your help. I found that tdName.innerHTML is the key to making it understand HTML tags instead of just text.
Thanks again. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|