x
<html>
<head>
<title>JS tutorial</title>
<style type="text/css">
body {
margin:40px 30px; padding:3px;
background-color:#eee; color:#444;
}
input {
font-family:"Lucida", serif; font-size:1.0em; color:#555;
}
</style>
<script type="text/javascript">
var result = 0;
function helloWorld(a, b, res) {
result = a.toUpperCase() + " " + b.toUpperCase();
res.textContent = "";
res.textContent = "Hello " + result + "!";
}
</script>
</head>
<body>
<form action="" method="post">
<input type="text" onfocus="this.value=''" value="first name" id="val1" />
<input type="text" onfocus="this.value=''" value="last name" id="val2" /><br /><br />
<input type="button" onclick=" helloWorld(val1.value, val2.value, res)" value="submit" />
</form>
<p id="res"></p>
</body>
</html>
Comments
No comments have been made yet.
Please login to leave a comment. Login now