I'm relatively new at JavaScript, but as far as I have gone it seems pretty similar to most other OO programming languages. Relatively. Different syntax, same concept. But for some reason, whenever I try to activate a function by clicking on a link, it won't work.
I know it's not my HTML, because the straight out "alert('this works')" link (the first one) works perfectly well, but as soon as i put it in a function it refuses to go. What am I doing wrong?
Apologies if this is hopelessly pathetic. As I said, I'm relatively new at JS.
Code:
<script language="JavaScript" type="text/javascript">
//more code here...
function testfunction()
{
alert("this works");
}
</script></head> <body bgcolor="454549" leftmargin="0">
<script>
var lastsubmitted
</script>
<a class="anchorStyle" onMouseDown="alert('this works')">Slideshow</a><br>
<a class="anchorStyle" onMouseDown="testfunction()">Next</a><br>
I know it's not my HTML, because the straight out "alert('this works')" link (the first one) works perfectly well, but as soon as i put it in a function it refuses to go. What am I doing wrong?
Apologies if this is hopelessly pathetic. As I said, I'm relatively new at JS.