I don't know what you mean by "alert code" exactly, but I think I have an idea. Just a button you click on and then shows a message. That's easy.
<html>
<head>
<script type="text/javascript">
function disp_alert()
{
alert("Text you want to be displayed in the box here")
}
</script>
</head>
<body>
<form>
<center><input type="button" onclick="disp_alert()" value="Text you want to appear on the button here"></center>
</form>
</body>
Edit what's in red to what you want to appear in the alert box (the box that appears when you click the button). Edit what's in blue to the text you want to be on the button.
Example:
<html>
<head>
<script type="text/javascript">
function disp_alert()
{
alert("This is an alert box!")
}
</script>
</head>
<body>
<form>
<center><input type="button" onclick="disp_alert()" value="Click here for an alert box!"></center>
</form>
</body>
PreviewOf course, this is very basic, but I guess I can make a more complicated one if necessary, I think.