Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with some code

2 views
Skip to first unread message

Michael_jd

unread,
Aug 24, 2004, 7:38:35 PM8/24/04
to
I have some code that is not working. Here it is:

<html>
<head>
<title>Exercise</title>

<script language="javascript"><!--

function picture(num)
{
alert("You clicked on picture " + num);
}


--//></script>

</head>

<body>

<a href="javascript:picture(1)"><img src="1.gif"></a>
<a href="javascript:picture(2)"><img src="2.gif"></a>
<a href="javascript:picture(3)"><img src="3.gif"></a>

</body>
</html>

I have three pictures on the page. When one clicks on the first picture one
gets a message that one clicked on the first picture. One gets the message
that one clicked on the second picture when one clicks on the second picture
and so on. When I click on any of the pictures nothing happens. What is
wrong?

Michael_jd was formerly Michael G.H.

sty

unread,
Aug 31, 2004, 11:25:22 AM8/31/04
to
michael...@Mhotmail.com (Michael_jd ) wrote in message news:<412b...@news.actrix.gen.nz>...

hi
your mistake is the end of the html-comment
--//></script>
must be
//-->

0 new messages