1、一个浏览器窗口中的DOM顺序是:window- >(navigator,screen,history,location,document)
2、得到表单中元素的名称和值:document.getElementById( "表单中元素的ID號 ").name(或value)
3、一个小写转大写的JS: document.getElementById( "output ").value = document.getElementById( "input").value.toUpperCase();
4、JS中的值类型:String,Number,Boolean,Null,Object,Function
5、JS中的字符型转换成数值型:parseInt(),parseFloat()
6、当文件中出现多个form表单时.可以用document.forms[0],document.forms[1]来代替.
7、弹出確认框:window.confirm();
8、弹出输入提示框:window.prompt();
9、创建一个文档元素:document.createElement(),document.createTextNode()
10、设置表单中所有文本型的成员的值为空:var form = window.document.forms[0]for (var i = 0; i <form.elements.length;i ){if (form.elements.type == "text "){form.elements.value = " ";}}
11、复选按钮在JS中判定是否选中:document.forms[0].checkThis.checked (checked属性代表为是否选中返回TRUE或FALSE)
12、单选按钮组判定是否被选中也是用checked.
13、下拉列表框的值:document.forms[0].selectName.options[n].value (n有时用下拉列表框名称加上.selectedIndex来確定被选中的值)
14、打开子窗口的父窗口为:opener
15、JS的內建对象有:Array,Boolean,Date,Error,EvalError,Function,Math,Number,Object,RangeError,ReferenceError,RegExp,String,SyntaxError,TypeError,URIError