js+jquery+html实现纯前端通讯录

使用js+jquery+html实现纯前端通讯录,包括联系人的增删改查以及展示详情

html部分代码

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.min.js"></script>
    <title>通讯录</title>
</head>
<style>
    .Contact {
     
        display: none;
        position: absolute;
        top: 20%;
        left: 34%;
        background-color: white;
        z-index: 2;
        width: 500px;
        height: 420px;
    }

    .Contact h2 {
     
        padding: 5px 20px;
        font-size: large;
        background-color: #555555;
        color: white;
    }

    .Contact .ifm {
     
        width: 300px;
        margin: 10px auto;
        display: flex;
        flex-flow: column nowrap;
    }

    .Contact .ifm div {
     
        margin: 10px;
    }

    .Contact .ifm div input {
     
        width: 220px;
        height: 20px;
    }

    .Contact .scbt {
     
        float: right;
        margin-top: 6px;
        margin-right: 30px;
    }

    .Contact .scbt button:first-of-type {
     
        width: 85px;
        height: 36px;
        background-color: #5cb85c;
    }

    .Contact .scbt button:last-of-type {
     
        width: 85px;
        height: 36px;
        background-color: white;
    }

    table {
     
        margin: 0 auto;
        width: 90%;
        text-align: center;
    }
</style>

<body onload="showStorage()">
    <div>
        <hr />
        <h1>通讯录</h1>
        <hr />
        <!-- 展示消息 -->
        <div>
            <div>
                <button id="add">新增</button>
                <script>
                    //点击新增按钮触发的动作
                    $("#add").click(function () {
     
                        $("#addContact").show();
                    });
                </script>
                <div>
                    <input type="text" name="person" id="search" placeholder="请输入联系人姓名">
                    <button type="button" onclick="search()">搜索</button>
                </div>
            </div>
            <table>
                <tbody>
                    <tr id="thead">
                        <td>序号</td>
                        <td>姓名</td>
                        <td>电话号</td>
                        <td>操作</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <!-- 新增联系人块 -->
    <div class="Contact" id="addContact">
        <h2>新增联系人</h2
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值