Got a little techonology problem that you need fixed pronto? Post it here and we'll see what we can do.
Topic locked

Bit of Javascript Code

Sun Jul 17, 2005 7:31 pm

Looking for some very simple Javascript code... This should give you the jist of what I want to do :)

Code:
<div name="Hello"> I am stuck in a dungeon of darkness </div>
<a href="name.text='I have escaped from the dungeon of darkness'">Escape</a>


Basically, I have an area of text, and want to be able to click a link to change that text. ALl help appreciated.

~ Matt

Mon Jul 18, 2005 12:06 pm

Code:
<div id="hello">I am stuck in a dungeon of darkness</div>
<a href="javascript:void(null);" onclick="a=document.getElementById('hello'); a.innerHTML = 'I have escaped from the dungeon of darkness';">Escape</a>
Topic locked