Hi there,
This will work:
Code:
<html>
<head>
<script language="Javascript">
function linkSomePage_onClick()
{
alert('This link is going nowhere');
return false;
}
</script>
</head>
<body>
<a id="idTest" href="http://flynpenoyer.com/Javascript/index2.html" name="linkSomePage">Click Me</a>
<script language="Javascript">
document.links[0].onclick = linkSomePage_onClick;
</script>
</body>
</html>
All I really changed was the onClick to onclick (case sensitive).
Word has a feature called Auto Correct that replaces straight quotes with "smart quotes" (yeah, right). If you want to code in Word, you should disable this feature. Choose Tools | AutoCorrect options" and then on the "AutoFormat as You Type" and "AutoFormat" tabs disable this feature.
Personally, I wouldn't recommend Word for coding. It's a nice Word processor, but not a good coding environment. If you want something text based, try Textpad, or some other freeware / shareware editors.
Alternatively, you can try an IDE, like Dreamweaver MX or Visual Studio for your coding. Those programs are not cheap, but worth their money, IMO.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.