日期:2014-05-17 浏览次数:20423 次
function EditInfo(obj) { $(obj).unbind("dblclick"); var objVal = $(obj).html(); var id = Math.round(Math.random(10000)); $(obj).html(""); $(obj).html("<input id='" + id + "' onblur='Recover(this)' type='text' value='" + objVal + "' style='width:80px;'/>"); $("#" + id).focus(); } function Recover(obj) { var inputVal = $(obj).val(); var tdObj = $(obj).parent(); var trObj = tdObj.parent(); tdObj.html(inputVal); tdObj.bind("dblclick", EditInfo(tdObj)); }