hi,
Please tell me what is wrong with this simple piece of code. It won't show up anything. Thank you.

<html>
<head>
<title>onclick</title>
</head>
<body>
<p>
<script language="javascript" type="text/javascript">
<a href="http://www.yahoo.com" onClick="alert('popup');">click this link</a>to test

</script>

</p>

</body>
</html>

It doesn't work because you don't need to surround the link with script tags for that inline javascript to work. The <a href="http://www.yahoo.com" onClick="alert('popup');">click this link</a> will work just fine on its own.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.