JS实现即点即编辑功能代码
效果如图所示:
分享代码喽:
" +
"" +
"
";
newTd.onclick = Function("switchShow(true, "+currEndLineId+", "+currTab+")");
}
function saveContent(){
var inputContentDiv = document.getElementById("inputContentDiv_"+currTab+"_"+eval("globalLineId_"+currTab));
var inputContent = document.getElementById("inputContent");
if(inputContentDiv !=null){
inputContentinputContentDiv.innerText = inputContent.innerText;
}
}
function deleteItem(){
var inputTd = document.getElementById("inputTd_"+currTab+"_"+eval("globalLineId_"+currTab));
var inputTab = document.getElementById("inputTab_"+currTab);
var inputRows = inputTab.rows;
var inputCells ;
var rowsLength = inputRows.length;
if (inputTd!=null){
for(i=1; i
|
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]