bootstrap 模态弹出框 常用**

2019-07-05 12:11:24 浏览数 (1)

image.png

<!doctype html> <html> <head> <meta charset="utf-8"> <title>联想控股</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="css/bootstrap.css" rel="stylesheet" type="text/css"> <script src="http://code.jquery.com/jquery.js"></script> <script src="js/bootstrap.min.js"></script> </head> <body> <button id="btn_add">add</button> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">新增</h4> </div> <div class="modal-body">

代码语言:javascript复制
            <div class="form-group">
                <label for="txt_departmentname">部门名称</label>
                <input type="text" name="txt_departmentname" class="form-control" id="txt_departmentname" placeholder="部门名称">
            </div>
            <div class="form-group">
                <label for="txt_parentdepartment">上级部门</label>
                <input type="text" name="txt_parentdepartment" class="form-control" id="txt_parentdepartment" placeholder="上级部门">
            </div>
            <div class="form-group">
                <label for="txt_departmentlevel">部门级别</label>
                <input type="text" name="txt_departmentlevel" class="form-control" id="txt_departmentlevel" placeholder="部门级别">
            </div>
            <div class="form-group">
                <label for="txt_statu">描述</label>
                <input type="text" name="txt_statu" class="form-control" id="txt_statu" placeholder="状态">
            </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
            <button type="button" id="btn_submit" class="btn btn-primary" data-dismiss="modal"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>保存</button>
        </div>
    </div>
</div>

</div> <script>

("#myModalLabel").text("新增"); $('#myModal').modal(); }); </script> </body> </html>

0 人点赞