• JS添加标签


    <script>
                function show(){
                    $('.add').unbind();
                    $('.low').unbind();

                    $('.add').click(function(){ // 加好;
                        var html=$(this).closest('tr').html();
                        var str='<tr class="tr">'
                            str+='<td><input name="material[]" type="text" /></td>'
                            str+='<td><input name="size[]" type="text" /></td>'
                            str+='<td><input name="membrane[]" type="text" /></td>'
                            str+='<td><input name="angle[]" type="text" /></td>'
                            str+='<td><input name="moq[]" type="text" /></td>'
                            str+='<td><input name="price[]" type="text" /></td>'
                            str+='<td><input name="duration[]" type="text" /></td>'
                            str+='<td><a href="javascript:;" class="low">-</a><a href="javascript:;" class="add">+</a></td>'
                            str+='</tr>'
                        $('.tbody').append(str);
                        // $(this).remove();
                        show();
                    })

                    $('.low').click(function(){ // 剑豪
                        if($('.tbody tr').length > 1){
                            $(this).parents('tr').remove();
                        }
                    })    
                }
                show();
            </script>

  • 相关阅读:
    第四章JAVA EE基础知识
    第二章代码审计环境搭建
    第三章代码审计辅助工具简介
    python json.dumps 中文需要注意的事项
    multiprocessing 使用实践
    Python中*args和**kwargs的使用实践
    python 继承学习记录
    关于vue-element-admin启动项目遇到的一些问题
    @RequestParam
    前端菜单点击切换样式,菜单控制iframe
  • 原文地址:https://www.cnblogs.com/sweet521/p/5695544.html
Copyright © 2020-2023  润新知