Click to See Complete Forum and Search --> : Text redirection


NWPhotoGuy
11-22-2003, 03:58 PM
I'd like to click on an image and generate new text in another table. I know how to generate a new picture elsewhere using DIVs and img "name=" but I have no idea how to do this with just plain text. Can someone help?

Thanks

fredmv
11-22-2003, 04:04 PM
Welcome to the forums, Don.

The simplest way to do this would be to access the element through the DOM and change it's innerHTML property to any text that you want. Here's a simple example:

<a href="#" onclick="document.getElementById('foo').innerHTML='Hello, World';">Change content to <q>Hello, World</q>.</a>
<div id="foo">bar</div>

There are other ways of doing this, but this is probably going to be the easist to understand and the quickest solution for the specific situation.

I hope that helps you out.

NWPhotoGuy
11-22-2003, 10:51 PM
Thanks very much. This was exactly what I needed. I'm gradually coming up the learning curve. :)

fredmv
11-22-2003, 10:52 PM
You're very welcome. :D