Næste
Forrige
Oversigt
JavaScript i HTML serie, Planche nr. 12
Kursus Indhold

Eksempel

Her er et eksempel med en formular...

<HEAD><TITLE>A Simple Document</TITLE>
<SCRIPT>
function update(form) {
   alert("Form being updated")
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="myform" ACTION="foo.cgi" METHOD="get" >Enter a value:
<INPUT TYPE="text" NAME="text1" VALUE="blahblah" SIZE=20 >
Check if you want:
<INPUT TYPE="checkbox" NAME="Check1" CHECKED    
   onClick="update(this.form)"> Option #1
<P>
<INPUT TYPE="button" NAME="button1" VALUE="Press Me"
   onClick="update(this.form)">
</FORM>
</BODY>
Eksempler på objektproperties:
Property Value
document.title
 "A Simple Document"
document.fgColor
 #000000
document.bgColor
 #ffffff
location.href

"http://www.royalairways.com/samples/simple.html"
history.length
 7


© 1999 BLA*net - Leif E. Andersen, leander@blanet.dk