View Full Version : Tell me what's wrong

03-10-2005, 03:51 AM
I have a pretty simple javascript on my site. I'm not the best with Javascript, so could someone tell me what is wrong. Here's the Javascript.

<script language="Javascript" type="text/javascript">
function viewpic(A,B,C)
document.getElementById("descriptiondiv").innerHTML="<p>" + C + "</p>"
My HMTL (condensed) is:

<a href="Javascript:viewpic(images/me.jpg,Picture of Me,This is a picture of me.)">Picture of me</a>
<img src="images/something.jpg" name="bigpicture" alt="picture"><br>
<div id="descriptiondiv"></div>
What is supposed to happen is - you click on the link that says Picture of Me (actually there will be lots of pictures) and the image by the name of "bigpicture" should change it's source and alternate text. Also a small description will get put in the div. It doesn't do any of that, and my FireFox Javascript Console didn't give me any error message, so I'm not sure what's wrong. Please help me out.

03-10-2005, 05:08 AM
There is no getElementByName method but getElementsByName and getElementsByTagName. But you won't need them.


or if you give an id to the image.