function addElement(){
var mouseover=function(){
this.style.backgroundColor='#EAEAEA';
};
var click=function(){
if(this.value=='修改'){
this.value='保存';
}
};
function addElem(e,type,value,mouseover,click){
var newElem = document.createElement(e);
newElem.setAttribute("type",type);
newElem.setAttribute("value",value);
newElem.setAttribute("onmouseover",mouseover);
newElem.setAttribute("onclick",click);
};
}
function makeTable(xmldoc, caption) {
var table = document.createElement("table");
table.setAttribute("class","tab-content");
document.body.appendChild(table);
table.createCaption().appendChild(document.createTextNode(caption));
var header = table.createTHead();
var headerrow = header.insertRow(0);
headerrow.insertCell(0).appendChild(document.createTextNode("特长名称"));
headerrow.insertCell(1).appendChild(document.createTextNode("特长描述"));
headerrow.insertCell(2).appendChild(document.createTextNode("修改"));
headerrow.insertCell(3).appendChild(document.createTextNode("删除"));
var body=table.createTBODY();
var UserSpecial = xmldoc.getElementsByTagName("UserSpecial");
for(var i=0;i<UserSpecial.length;i++) {
var e = UserSpecial;
var Title = e.getElementsByTagName("Title")[0].firstChild.data;
var Comment = e.getElementsByTagName("Comment")[0].firstChild.data;
var row = table.insertRow(i+1);
row.insertCell(0).appendChild(document.createTextNode(Title));
row.insertCell(1).appendChild(document.createTextNode(Comment));
row.insertCell(2).appendChild(addElem("input","button","修改",mouseover,click));
row.insertCell(3).appendChild(addElem("input","button","删除",mouseover,click));
}
}