[Overview] [Basics] [More] [Fun] [Class 2] [If] [Functions] [Timing] [Queries] [References] [Examples] [Libraries] [Assignments]
A simple illustration of defining and using JavaScript functions. Enter your name and click on the "Click Me" button.
<script language="javascript1.1">
function mungeName(person)
{
return person + "aroo"
}
</script>
<form name="sample">
<input type="text" name="person" value="">
<input type="button"
name="clickme"
value="Click Me"
onClick="document.sample.person.value=mungeName(document.sample.person.value)">
</form>
[Overview] [Basics] [More] [Fun] [Class 2] [If] [Functions] [Timing] [Queries] [References] [Examples] [Libraries] [Assignments]
Source text written by Samuel A. Rebelsky.
This page may be found at http://www.math.grin.edu/~rebelsky/Tutorials/JavaScript/Spring1999/Examples/mungename.html
Source text last modified Wed Apr 14 12:20:57 1999.
This page generated on Wed Apr 14 12:27:06 1999 by SiteWeaver. Validate this page's HTML.