<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">
<!-- #include virtual="~/shared/top.inc" -->
<div class="header"><h2>Abakada DHTML Demo: <span class="hilite">onclick Event Handler</span> Example</h2></div>
<hr size=1 width=92%>
<center>
<p>This example uses the <b>onclick</b> event of a button</p>
<p>to trigger a function that detects the contents of the textbox</p>
<p>and displays it in a dialog box. </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>