function tdclick(obj) { var txt = $(obj.outerHTML).text(); if (txt != null && txt != "") { if (obj.childNodes.length > 0) { obj.childNodes[0].data = ''; } else { obj.textContent = ""; } } //td表格里加input将值赋予input记录下,在删除input框 var inputobj = ($("<input type='text' maxlength='60' style='width: 100%; height: 15px'/>") .css("border", "0")).css("background-color", "#FFFFCC") .appendTo(obj); inputobj.trigger("focus"); inputobj.val(" " + txt); inputobj .focusout(function() { if (obj.childNodes[0].nodeName == "#text") { obj.childNodes[0].data = inputobj.val(); } else { obj.innerHTML = inputobj.val(); } inputobj.remove(); var oper = obj.id; if (oper !== 'add') { if (updateIds == "") { updateIds = obj.id + ";" + inputobj.val() + ";"; } else { updateIds = updateIds + "@" + obj.id + ";" + inputobj.val() + ";" ; } } }); $(obj.outerHTML).find("input[value='']").remove(); }
?