Sun Sep 18, 2011 12:31 am
<html>
<title>Pass parameter </title>
<head>
<script language="JavaScript" type="text/javascript">
<!--
function passParameter(age){
document.getElementById('output').innerHTML = "Your age is " + age + " !";
alert("Your age is " + age + " !";);
}
//-->
</script>
</head>
<body>
<div id="output">Print age here</div>
<form name="ageForm">
<input type="text" name="age" value="Please enter your age" onfocus="document.ageForm.age.value=''">
<input type="button" onclick="passParameter(document.ageForm.age.value)" value="Submit">
</form>
</body>
</HTML>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.