Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

Changing contents of div or paragraph with a link in CSS

4:37 pm on Dec 13, 2001 (gmt 0)

Junior Member

10+ Year Member

joined:July 24, 2001
votes: 0

How can I change the contents of a div or paragraph when the user presses a link using CSS? I am trying to create an image gallery where the user presses a thumbnail and the full image displays. I don't want to use pop-up windows and I don't want to refresh the screen or use frames. Can this be done easily?
5:55 pm on Dec 13, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 10, 2001
votes: 0

Try this little sample, uses the innerHTML property. Won't work in NN4 but will in pretty much everything else.


function updateTestParagraph(string)
document.getElementById('test').innerHTML = string

var testString = "Look, DHTML wonder eh?"

<a href="javascript:updateTestParagraph(testString);" >click here</a>
<p id="test"></p>


6:29 pm on Dec 13, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member rcjordan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 22, 2000
votes: 0

DHTML can add an SSI-type injection into a div. Here's the best one I've found to date, it works on NS4, NS6, & IE4 up.



Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members