homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

Changing contents of div or paragraph with a link in CSS

 4:37 pm on Dec 13, 2001 (gmt 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)

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)

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.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved