<html>
<head>
<title>Abakada DHTML Demo: onclick Event Handler Example</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="JavaScript">
function getName ( ) {
if ( txtName.value.length == 0 ) alert ( "You have not entered any text." );
else alert ( "Hello " + txtName.value + ". Welcome to DHTML." );
}
</script>
</head>
<body">
<div class="header"><h2>Abakada DHTML Demo: <b>onclick Event Handler</b> Example</h2></div>
<hr size=1 width=92%>
<center>
<h4>This example uses the <b>onclick</b> event of a button<br>
to trigger a function that detects the contents of the textbox<br>
and displays it in a dialog box.</h4>
<p><b>Enter your name:</b> <input id="txtName" name="txtName">
<p><input type="button" value="What is your name?" onclick="getName ( )">
</center>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>