Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 07-27-2004, 03:13 PM   #1
Member (10 bit)
 
Join Date: May 1999
Location: Orlando, FL
Posts: 975
Send a message via ICQ to artsapimp
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.
artsapimp is offline   Reply With Quote
Old 07-27-2004, 07:40 PM   #2
Barefoot on the Moon!
Staff
Premium Member
 
Force Flow's Avatar
 
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.
Force Flow is offline   Reply With Quote
Old 07-28-2004, 06:59 AM   #3
Member (10 bit)
 
Join Date: May 1999
Location: Orlando, FL
Posts: 975
Send a message via ICQ to artsapimp
< td id='TestTD' >
< script language=' javascript ' >
function changeTD(tdName){
tdName.innerText = 'Test'
}
< /script >
artsapimp is offline   Reply With Quote
Old 07-28-2004, 07:57 AM   #4
Barefoot on the Moon!
Staff
Premium Member
 
Force Flow's Avatar
 
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
PHP Code:
tdName.innerText '<b> + Test + </b>' 
Give that a try.

If "Test" is just text and not a variable, try this:

PHP Code:
tdName.innerText '<b> + "Test" + </b>' 

Last edited by Force Flow; 07-28-2004 at 08:00 AM.
Force Flow is offline   Reply With Quote
Old 07-28-2004, 08:01 AM   #5
Member (10 bit)
 
Join Date: May 1999
Location: Orlando, FL
Posts: 975
Send a message via ICQ to artsapimp
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.
artsapimp is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:50 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2