NextIndexPrevious

Programs in JavaScript

13. onSubmit example.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function fun1()
{
	txt = document.getElementById("name").value
	alert("Hello "+txt)
}

</script>
</head>

<body>
<form onsubmit="fun1()">
Name : <input type="text" id="name"/>
<input type="submit" value="Hello" />
</form>

</body>
</html>

Output :

Name :




Father of JavaScript


Brendan Eich

Brendan Eich

Born: 1961, Pennsylvania