if(xg==’修改’){
$(‘.edit’).each(function(){
var old=$(this).html();
$(this).html("<input type=’text’ name=’editname’ class=’text’ value="+old+" >");
})
$(obj).html(‘保存’);
}else if(xg==’保存’){
$(‘input[name=editname]’).each(function(){
var old=$(this).html();
var newfont=$(this).parent(‘td’).parent(‘tr’).children().find(‘input’).val();
$(this).parent(‘td’).html(newfont);
})
$(obj).html(‘修改’);
}
}
</script>
</body>
</html>
以上这篇点击按钮文字变成input框,点击保存变成文字的实现代码就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持软件开发网。
原文地址:http://www.cnblogs.com/yuxiaoqi912/p/5470354.html









