1 动态设置元素位置、大小(加单位px 设定脱离文档position) 通过dom读取元素的top,left.right,bottom,width,height等都 是10px之类的字符串 元素的position样式值:static无定位,默认位置 absolute绝对位置 fixed相对于窗口的固定位置 relative相对元素默认位置 2 常见应用:document.createElement(TagName) 创建元素 parentElement.appendChild(Element) 附加子节点 document.GetElementById(ElementId) 通过ID获取元素 document.GetElementsTagName(ElementsTagName) 通过标签名称获取元素 document.GetElementsName(ElementsName) 通过Name获得元素 parentNode.removeChild(Element) 移除元素 Element.innerText 获取或设置元素的innerText Element.innerHTML 获取或设置元素的innerHTML Element.ClassName 获取或这是元素的样式表 Element.style 同上 Element.getAttribute(attributeName) 获取元素的Value Element.setAttribute(attributeName,attributeValue)设置元素的Value window.onload=function(){} 绑定窗体加载事件 Element.onclick=function(){} 绑定窗体单击事件 层的操作: 左上右下,先左上 .标签原油的属性可以直接出来。 getAttribute,setAttributa style display默认none 文本框onchange文本改变,且失去焦点时触发