这次给大家带来怎样实现点击按钮文字变成input框,点击保存变成文字的实现的效果,实现实现点击按钮文字变成input框,点击保存变成文字效果的注意事项有哪些,下面就是实战案例,一起来看一下。
点击按钮文字变成input框,点击保存变成文字table{ text-align: center; font-size: 14px;}
table>thead>tr>th{ font-weight: normal;}
.text-right{ padding-right:73px; text-align: right;}
.text{ width: 50px; height: 30px; border: 1px solid #ddd; text-align: center;}
品名件数
iPhone6s2小米55修改
function change(obj){
var xg=$(obj).html();
if(xg=='修改'){
$('.edit').each(function(){
var old=$(this).html();
$(this).html("");
})
$(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('修改');
}
}
相信看了这些案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!
相关阅读: