jQuery实现点击表格单元格就可以编辑内容的方法

        $('table td').click(function(){
            if(!$(this).is('.input')){
                $(this).addClass('input').html('<input type="text" value="'+ $(this).text() +'" />').find('input').focus().blur(function(){
                $(this).parent().removeClass('input').html($(this).val() || 0);
                });
            }
        }).hover(function(){
            $(this).addClass('hover');
        },function(){
            $(this).removeClass('hover');
        });
原文地址:https://www.cnblogs.com/Jonecmnn/p/7660959.html