Three Buttons Sharing One Function
<HTML> <HEAD> <TITLE>Button Click</TITLE> <SCRIPT LANGUAGE="JavaScript"> function displayTeam(btn) { if (btn.value == "A") {alert("A")} if (btn.value == "R") {alert("R")} if (btn.value == "M") {alert("M")} } </SCRIPT> </HEAD> <BODY> Click on your favorite half of a popular comedy team:<P> <FORM> <INPUT TYPE="button" VALUE="A" onClick="displayTeam(this)"> <INPUT TYPE="button" VALUE="R" onClick="displayTeam(this)"> <INPUT TYPE="button" VALUE="M" onClick="displayTeam(this)"> </FORM> </BODY> </HTML>