m0_37778468 2019-06-18 19:21 采纳率: 28.6%
浏览 304
已结题

如图所示功能如何实现,请大神指教

如图所示功能如何实现,请大神指教图片说明

  • 写回答

4条回答 默认 最新

  • threenewbee 2019-06-18 19:39
    关注

    你既然有截图,那么你可以直接f12去看对应的html和js代码,照着模仿就可以了。
    这个无非就是动态添加表格行,里面有各种input

    评论
  • qq_35151346 2019-06-18 23:03
    关注

    你要实现的是这个前端页面,还是后台功能,还是前后台都要?

    评论
  • lllomh 2019-06-19 13:01
    关注

    直接 jq 点击添加 dom 不就行了嘛 真是的

    评论
  • 会飞的咕咕鱼 2019-06-24 16:00
    关注

    我简单给你写了个,你把细节完善一下就好了
    图片说明

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <style>
            span {
                cursor: pointer;
            }
    
            .add {
                display: inline-block;
                width: 101px;
                height: 30px;
                line-height: 30px;
                background: #0089ff;
                color: #fff;
                font-size: 12px;
                text-align: center;
                margin-bottom: 20px;
            }
    
            input {
                width: 80px;
                height: 22px;
                margin: 0 10px;
            }
    
            .listBox {
                margin-bottom: 14px;
            }
    
            .quote {
                font-size: 10px;
                margin-left: 40px;
            }
    
            .quote span {
                margin-right: 10px;
                color: #0089ff;
            }
    
            .quote span:last-child {
                color: #f00;
            }
        </style>
    </head>
    
    <body>
        <span class="add" onclick="addList()">+添加硬件报价</span>
        <div class="quote">
    
        </div>
    </body>
    <script src="../js/jquery-1.12.3.min.js"></script>
    <script>
        var count = 0;
    
        function addList() {
            count++;
            $('.quote').append(` <div class="listBox">${count}<input type="text"><input type="text"><input type="text">单价<input type="text">数量<input type="text"> 合计<input type="text"> <span onclick="add(this)">添加</span><span onclick="remove(this)">删除</span></div>`);
        }
    
        function add() {
            // 这个添加方法,你可以根据需求去实现
        }
    
        function remove(op) {
            $(op).parent('div').remove();
        }
    </script>
    
    </html>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 利用加权最小二乘法求亚马逊各类商品的价格指标?怎么求?
  • ¥15 c++ word自动化,为什么可用接口是空的?
  • ¥15 Matlab计算100000*100000的矩阵运算问题:
  • ¥50 VB6.0如何识别粘连的不规则的数字图片验证码
  • ¥16 需要完整的这份订单所有的代码,可以加钱
  • ¥30 写一个带界面控制的机房电脑一键开机关机并且实时监控的软件
  • ¥15 Stata数据分析请教
  • ¥15 请教如何为VS2022搭建 Debug|win32的openCV环境?
  • ¥15 关于#c++#的问题:c++如何使用websocketpp实现websocket接口调用,求示例代码和相关资料
  • ¥15 51单片机的外部中断,按下按键后不能切换到另一个模式