Kod:
<!-- TWO STEPS TO INSTALL FUNCTION CREATION:
1. Copy the coding into the HEAD of your HTML ********
2. Add the last code into the BODY of your HTML ******** -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML ******** -->
<HEAD>
<script type="text/javascript">
<!-- Begin
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Steeveeo :: http://www.freewebs.com/steeveeo3000/ */
function confirmFunction() {
alert("This message will confirm whether or not to perform a function");
if (confirm("Are you sure you want to activate the function?"))
{
functionAlert();
}
else
alert("Function cancelled.");
{
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML ******** -->
<BODY>
<script type="text/javascript">
<!-- Begin
function functionAlert() {
alert("Your function here");
{
}
}
// End -->
</script>
<div align="center">
<form>
<input type="button" value="Confirm The Function" onClick="confirmFunction()">
</form>
</div>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 1.25 KB -->