View Full Version : Problem with Span

08-17-2005, 08:46 AM
Hi guys, could one of you look at this code if you get a chance - it's not working for me:

*Essentially what I am trying to do is have a description of a thumbnail appear in a "span" when a user clicks on a thumbnail (as well as a full version of the photo appear in another part of the table, which currently works okay). For some reason or another, it's just not happening.


<link rel="stylesheet" href="style.css"/>



<h1>Photo Page</h1>

<h2>My Favorite Holiday</h2>

<table width="100%" border="0">
<td><img src="images/thumbs/holiday1thumb.jpg" width="100" height="75" onClick="document.getElementById('picture').src='images/full/holiday1.jpg'; document.getElementById('info').innerText='My wife Katrina and I dining'"></td>
<td rowspan="4"><img id=picture src="images/fill.gif"></td>
<td><img src="images/thumbs/holiday2thumb.jpg" width="75" height="100" onClick="document.getElementById('picture').src='images/full/holiday2.jpg';"></td>
<td><img src="images/thumbs/holiday3thumb.jpg" width="100" height="75" onClick="document.getElementById('picture').src='images/full/holiday3.jpg';"></td>
<td><img src="images/thumbs/holiday4thumb.jpg" width="100" height="75" onClick="document.getElementById('picture').src='images/full/holiday4.jpg';"></td>

<br /><br />

<p><span id=info></span></p>



08-17-2005, 03:27 PM

I think you wanted innerHTML.

08-18-2005, 12:52 AM
I changed it, and it worked - thank you very much.

Is InnerHTML W3C compliant?

08-18-2005, 03:04 PM
But it's pretty well supported.
If you want it to specs, you have to use createElement, appendChild, and the like. More work. Might be more cross-browser, but all the major ones right now support innerHTML.