...

View Full Version : *Help* editing a div



mr_Al
01-03-2005, 06:25 PM
hey everyone,
i'm a new comer really, so go easy on me....

i'm making a script which flips topics on a news system, using divs so it updates on the page. i'm trying to insert text into a div as this happens.

i've tried using

var ndiv = document.getElementById("newsMain"):
then using

ndiv.document.open();
ndiv.document.write("news stuff");
ndiv.document.close();


with no result :(
*edit*
i get an object doesn't support this method error on loading the page

would be grateful for any help,
Al.

Willy Duitt
01-03-2005, 06:27 PM
Try ndiv.innerHTML = 'news stuff';

mr_Al
01-03-2005, 06:41 PM
oh wow man, thanks :cool:
i could hug you or buy you a beer... maybe both but i'd probably spill it on your new shirt...

hehe THANK YOU !!! :)
:thumbsup: :thumbsup:

mr_Al
01-03-2005, 06:54 PM
ok one more question, with this can i also put HTML in there too?

thanks,

Al.

*edit*
nevermind fixed that i think... thanks for your help

_Aerospace_Eng_
01-10-2005, 12:41 AM
yep u can use html while using the innerHTML function just be sure instead of using " use ' if you use quotes it will end the function too soon because the " tells the function when to end, so just have the opening innerHTML quote and the one that ends it so like instead of <img src="yourimage.jpg"> you would do
<img src='yourimage.jpg'>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum