Inside the Head part of your HTML code type this:
and inside the body of your HTML code type this:
<script type="text/javascript" >
function alerter(){
alert ("Hello World!");
}
</script>
function alerter(){
alert ("Hello World!");
}
</script>
and inside the body of your HTML code type this:
<a href="#" onclick="alerter();" >Click Me</a>