Function Programs

Function with one argument


<!DOCTYPE html>
<html>
<head>
<script>
  function usefunction(txt) {

    alert(txt);

  }
</script>
</head>

<body>

<form>	
	<input type="button" onclick="usefunction(' Good Morning ')" value="It's Morning" >
	<input type="button" onclick="usefunction(' Good Evening ')" value="It's Evening" >
</form>

<p>
	<strong>Note : </strong>
	When you click on one of the buttons, a function will be called.
    The function will alert the argument that is passed to it.
</p>

</body>
</html>