It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Write new stuff to a page.

Write new stuff to a page.

Postby Kasper Hviid on Sun Aug 10, 2008 2:04 am

I want to overwrite the content of a page with some new html code.

I through it was this:

document.write("My brand new content");

But it seem to add the previous content of the page, instead of replacing it.
Kasper Hviid
 
Posts: 2
Joined: Sun Aug 10, 2008 1:59 am

Postby Kasper Hviid on Sun Aug 10, 2008 4:21 am

I just got the answer:

document.body.innerHTML = "<h1>This is content overriding.</h1>";
Kasper Hviid
 
Posts: 2
Joined: Sun Aug 10, 2008 1:59 am


Who is online

Users browsing this forum: No registered users and 5 guests