function getSquareFeet() {
with (window.document.forms[0]) {
SquareFeet.value = Width.value * Length.value
}
}
次の onFocus イベントハンドラは Length と Width フィールドの両方に関数を呼びます。
getSquareFeet()
window.status = "Domino window opened"
n = navigator
alert (n.appName + " " + n.appVersion + " on " + n.platform)
location.href = "http://localhost/Web+test.nsf/Main+View"
window.status = "Page one"
window.status = "Page two"
for (n = 0; n < top.length; n++) {
alert(top.frames[n].name)
}
for (n = 0; n < top.length; n++) {
w = top.frames[n]
if (w.length == 0) {
alert (w.name)
}
else {
for (nn = 0; nn < w.length; nn++) {
ww = w.frames[nn]
alert (w.name + ": " + ww.name)
}
}
}
for (n = 0; n < window.document.applets.length; n++) {
alert (window.document.applets[n].name)
}
onClick="return confirm('Go?')"
document.ThePicture.src = "/Web+Test.nsf/newdam.gif"
e = window.document.forms[0].elements
for (n = 0; n < e.length; n++) {
if (e[n].name == "") ee = "NO NAME"
else ee = e[n].name
t = e[n].type
if (e[n].value == "") v = "NO VALUE"
else v = e[n].value
alert (ee + "¥n" + t + "¥n" + v)
}
one = window.document.forms[0].FieldOne.value
two = window.document.forms[0].FieldTwo.value
if (one == "NONE" && two != "") {
window.document.forms[0].FieldTwo.value = ""
alert ("FieldTwo must be blank if FieldOne is NONE")
}
with (window.document.forms[0].MyList) {
for (n=0; n<length; n++) {
if (options[n].selected) {
alert (options[n].text)
}
}
}
with (window.document.forms[0]) {
for (n=0; n<elements.length; n++) {
if (elements[n].type == "hidden") {
alert (elements[n].name + "¥n" + elements[n].value)
}
}
}