IE兼容性问题(火狐兼容,IE不兼容)
vari=0;//自定义摘要函数functionaddSort(){varname=document.getElementById("add").value;if(nam...
var i=0;
// 自定义摘要函数
function addSort() {
var name = document.getElementById("add").value;
if(name == "" ) {
return;
}
i++;
var row = document.createElement("span");
row.setAttribute("id", name);
var cell = document.createElement("td");
cell.setAttribute("style","cursor:default");
cell.setAttribute("id","liner");
var url= document.createElement("a");
url.setAttribute("style","border:1px solid #ffd7dd
");
url.setAttribute("herf","#");
url.setAttribute("id","con"+i);
url.setAttribute("onMouseOver","getPage0(1,id)");
url.setAttribute("onClick","getPage10(1,id)");
url.setAttribute("name","tip"+i);
url.setAttribute("value",name);
url.appendChild(document.createTextNode(name));
var count = document.createElement("span");
count.setAttribute("id","tip"+i);
url.appendChild(count);
cell.appendChild(url);
row.appendChild(cell);
var deleteButton = document.createElement("input");
deleteButton.setAttribute("type", "button");
deleteButton.setAttribute("value", "删除");
deleteButton.onclick = function () { deleteSort
(name); };
cell = document.createElement("td");
cell.appendChild(deleteButton);
row.appendChild(cell);
document.getElementById("sortList").appendChild
(row);
//清空输入框
document.getElementById("add").value = "";
}
</script> 展开
// 自定义摘要函数
function addSort() {
var name = document.getElementById("add").value;
if(name == "" ) {
return;
}
i++;
var row = document.createElement("span");
row.setAttribute("id", name);
var cell = document.createElement("td");
cell.setAttribute("style","cursor:default");
cell.setAttribute("id","liner");
var url= document.createElement("a");
url.setAttribute("style","border:1px solid #ffd7dd
");
url.setAttribute("herf","#");
url.setAttribute("id","con"+i);
url.setAttribute("onMouseOver","getPage0(1,id)");
url.setAttribute("onClick","getPage10(1,id)");
url.setAttribute("name","tip"+i);
url.setAttribute("value",name);
url.appendChild(document.createTextNode(name));
var count = document.createElement("span");
count.setAttribute("id","tip"+i);
url.appendChild(count);
cell.appendChild(url);
row.appendChild(cell);
var deleteButton = document.createElement("input");
deleteButton.setAttribute("type", "button");
deleteButton.setAttribute("value", "删除");
deleteButton.onclick = function () { deleteSort
(name); };
cell = document.createElement("td");
cell.appendChild(deleteButton);
row.appendChild(cell);
document.getElementById("sortList").appendChild
(row);
//清空输入框
document.getElementById("add").value = "";
}
</script> 展开
展开全部
您好!很高兴为您答疑!
document.getElementById只能在IE下才有效,火狐不支持。
您可以在火狐社区了解更多内容。希望我的回答对您有所帮助,如有疑问,欢迎继续在本平台咨询。
document.getElementById只能在IE下才有效,火狐不支持。
您可以在火狐社区了解更多内容。希望我的回答对您有所帮助,如有疑问,欢迎继续在本平台咨询。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询