<HTML> <HEAD> </HEAD> <BODY> <INPUT TYPE=BUTTON VALUE="This button does nothing"> </BODY> </HTML> |
<HTML> <HEAD> </HEAD> <BODY> <INPUT TYPE=BUTTON VALUE="Click here" ONCLICK="alert('Please do not click on this button again!')"> </BODY> </HTML> |
<HTML> <HEAD> </HEAD> <BODY> <FORM ACTION="#" NAME="convert"> Enter Inches <INPUT TYPE=TEXT NAME="ins" ONKEYUP=" document.convert.cms.value = 2.54 * document.convert.ins.value" > <BR><BR> <INPUT TYPE=TEXT NAME="cms" DISABLED> centimetres </FORM> </BODY> </HTML> |
<HTML> <HEAD> </HEAD> <BODY> <FORM ACTION="#" NAME="temp"> Enter Fahrenheit <INPUT TYPE=TEXT NAME="fahr" SIZE=3 ONKEYUP="document.temp.cels.value = (document.temp.fahr.value - 32) * 5 / 9"> <BR><BR> <INPUT TYPE=TEXT NAME="cels" SIZE=3 DISABLED> Celsius </FORM> <SCRIPT TYPE="TEXT/JAVASCRIPT"> document.temp.fahr.focus() </SCRIPT> </BODY> </HTML> |
<HTML> <HEAD> </HEAD> <BODY> <FORM ACTION="#"> <TEXTAREA COLS=36 ROWS=4> `Twas brillig, and the slithy toves Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. </TEXTAREA> </FORM> </BODY> </HTML> |
<HTML> <HEAD> </HEAD> <BODY> <FORM ACTION="#" NAME=temp> Enter Celsius <INPUT TYPE=TEXT NAME="cels" SIZE=3> <BR><BR> <INPUT TYPE=BUTTON VALUE="Convert to Fahrenheit" ONCLICK="document.temp.fahr.value = document.temp.cels.value + ' degrees Celsius' + '\n' + 'is ' + ((document.temp.cels.value * 9 / 5) + 32) + ' degrees Fahrenheit'"> <BR><BR> <TEXTAREA NAME=fahr COLS=30 ROWS=2 DISABLED> </TEXTAREA> </FORM> </BODY> </HTML> |
<HTML> <HEAD> </HEAD> <BODY> <FORM ACTION="#" NAME=times> <SELECT NAME="num1" ONCHANGE="document.times.answer.value = document.times.num1.selectedIndex * document.times.num2.selectedIndex"> <OPTION>zero</OPTION> <OPTION>one</OPTION> <OPTION SELECTED>two</OPTION> <OPTION>three</OPTION> <OPTION>four</OPTION> <OPTION>five</OPTION> </SELECT> multiplied by <SELECT NAME="num2" ONCHANGE="document.times.answer.value = document.times.num1.selectedIndex * document.times.num2.selectedIndex"> <OPTION>zero</OPTION> <OPTION>one</OPTION> <OPTION SELECTED>two</OPTION> <OPTION>three</OPTION> <OPTION>four</OPTION> <OPTION>five</OPTION> </SELECT> = <INPUT TYPE=TEXT NAME="answer" SIZE=2 DISABLED> </FORM> </BODY> </HTML> |
<HTML> <HEAD> </HEAD> <BODY> <FORM ACTION="#" NAME=latin> <SELECT NAME="words" ONCHANGE="alert(document.latin.words.value)"> <OPTION VALUE="- Select a Latin phrase -">- Select a Latin phrase -</OPTION> <OPTION VALUE="Truth in wine">In vino veritas</OPTION> <OPTION VALUE="Art for art's sake">Ars gratia artis</OPTION> <OPTION VALUE="I think therefore I am">Cogito ergo sum</OPTION> <OPTION VALUE="I came, I saw, I conquered">Veni, vidi, vici</OPTION> <OPTION VALUE="Beware of the dog">Cave canem</OPTION> </SELECT> </FORM> </BODY> </HTML> |
It is also possible to access what gets shown in the menu.
document.latin.words.options[3].innerHTML will give Cogito ergo sum.
document.latin.words.options[document.latin.words.selectedIndex].innerHTML will give the latin that is selected at the moment.
<HTML> <HEAD> </HEAD> <BODY> <FORM ACTION="#" NAME=date> <INPUT TYPE="radio" NAME="today" CHECKED ONCLICK="document.date.show.value=new Date().getFullYear()">Year <BR> <INPUT TYPE="radio" NAME="today" ONCLICK="document.date.show.value= (new Date().getMonth()) + 1">Month <BR> <INPUT TYPE="radio" NAME="today" ONCLICK="document.date.show.value= new Date().getDate()">Day of month <BR><BR> <INPUT TYPE=TEXT NAME="show" SIZE=4 DISABLED> </SELECT> </FORM> <SCRIPT TYPE="TEXT/JAVASCRIPT"> document.date.show.value=new Date().getFullYear() </SCRIPT> </BODY> </HTML> |
© Jo Edkins 2005