Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell drive driver drivers email error ethernet excel firefox firefox 3 freeze hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition password problem router slow software sound trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Way to work this?


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
redivivus's Avatar
Senior Member with 1,458 posts.
 
Join Date: Mar 2006
Experience: 8th hindu reincarnation -- Praise Allah
06-Nov-2006, 02:55 PM #1
Way to work this?
Say i want to write some html into a <div>, and i want to include some <span>s inside this <div>. I then want to edit the content of the <span> tags later on. The <div> starts empty at page load, and then it is filled based on some variables.

Doesnt work when i try something like this...

spanid.innerHTML=...
OR
document.getElementsById('spanid').innerHTML=...

It says there is no element with that ID.

Is there a way to work this other than rewriting the whole <div>?

Peace.
__________________
Knowing others is wisdom;
Knowing the self is enlightenment.
Mastering others requires force;
Mastering the self needs strength.
~ Lao Tzu

If the rest of them can survive only by destroying us, then why should we wish them to survive?
~ Ayn Rand
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
06-Nov-2006, 03:04 PM #2
I think you need to use createElement() to create your span, then use appendChild() to stick it inside your div.
redivivus's Avatar
Senior Member with 1,458 posts.
 
Join Date: Mar 2006
Experience: 8th hindu reincarnation -- Praise Allah
06-Nov-2006, 07:59 PM #3
Quote:
Originally Posted by brendandonhu
I think you need to use createElement() to create your span, then use appendChild() to stick it inside your div.
Cool i will be googling those.
covert215's Avatar
Account Disabled with 2,651 posts.
 
Join Date: Apr 2006
Experience: Web Designer
06-Nov-2006, 09:05 PM #4
I was looking through some DOM charts....couldn't find anything good
redivivus's Avatar
Senior Member with 1,458 posts.
 
Join Date: Mar 2006
Experience: 8th hindu reincarnation -- Praise Allah
07-Nov-2006, 01:15 PM #5
Interesting!

Managed to get a new window with a div that can be editted by the main window.
covert215's Avatar
Account Disabled with 2,651 posts.
 
Join Date: Apr 2006
Experience: Web Designer
07-Nov-2006, 01:26 PM #6
Impressive. Web development has become much less design and much more coding in the past year. I'm trying to keep up. I'm in the middle of the 1000 page XML bible.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:44 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.