判定浏览器类型:if(document.uniqueID)如果为TRUE是IE,否则非IE。
1向表中追加行
2通过JAVASCRIPT设置元素的样式
3设置元素的CLASS属性
4创建输入元素
5向输入元素增加事件处理程序
6创建单选按钮
- 1.
- <table id="MyTable>
- <tbody id="MyTableBody"></tbody>
- </table>
- var cell = documentcreateElement("td").appendChild(document.createTextNode("foo"));
- var row = document.createElement("tr").appendChild(cell);
- document.getElementById("MyTableBoyd").appendChild(row);
- 2.
- var spanElement = document.getElementById("myspan");
- //spanElement.setAttribute("style","font-weight:bold;color:red");
- spanElement.style.cssText="font-weight:bold;color:red";
- 3.
- element.setAttribute("class","stylename");//非IE
- element.setAttribute("className","stylename");//IE
- 4.
- var button = document.createElement("input");
- button.setAttribute("type","button");
- document.getElementById("form").appendChild(button);
- 5.
- var element = document.getElementById("ee");
- element.onclick=function(){todo();};
- 6.
- var ration = document.createElement("<input type='radio' name='radioa' value='checked'>);//ie
- vat radion = document.createElement("input");
- radion .setAttribute("type","radio");
- radion.setAttribute("name","radionsss");
- radion.setAttribute("value","checked");
posted on 2006-06-21 21:55
xzc 阅读(285)
评论(0) 编辑 收藏 所属分类:
XML