Write text inside a div with a given ID

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Write text inside a div with a given ID

Post by klevis miho »

I have this div:

<div id="test">
</div>

How can I write something inside this div, for example:

<div id="test">
write something here
</div>

Any help will be great appreciated.
User avatar
tr0gd0rr
Forum Contributor
Posts: 305
Joined: Thu May 11, 2006 8:58 pm
Location: Utah, USA

Re: Write text inside a div with a given ID

Post by tr0gd0rr »

Code: Select all

document.getElementById("test").innerHTML = "write something here";
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: Write text inside a div with a given ID

Post by klevis miho »

Thnx :)
Post Reply