js语句3
状态栏的设置:
window.status="字符";
弹出提示信息:
window.alert("字符");
弹出确认框:
window.confirm();
弹出输入提示框:
window.prompt();
指定当前显示链接的位置:
window.location.href="http://www.test.com"
取出窗体中的所有表单的数量:
document.forms.length
关闭文档的输出流:
document.close();
字符串追加连接符: =
创建一个文档元素:
document.createElement(),document.createTextNode()
得到元素的方法:
document.getElementById()
设置表单中所有文本型的成员的值为空:
var form = window.document.forms[0]
for (var i = 0; i<form.elements.length;i ){
if (form.elements.type == "text"){
form.elements.value = "";
}
}
浙公网安备 33010602011771号