zoukankan      html  css  js  c++  java
  • JQ remove()方法实现似收货地址逐一删除的效果

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>内容显示限定字数</title>
    </head>
    <style type="text/css">
        .box{width:100%;background:pink;height:40px;color:green;line-height:40px;margin-bottom:20px;}
        .fc{clear:both;}
        .fl{float:left;padding-left:30px;}
        .fr{float:right;color:red;padding-right:30px;cursor:pointer}
    </style>
    <body>
    <div class="box">
        <div class="fc">
            <div class="fl">我怀念的,是无话不说</div>
            <div class="fr del">删除</div>
        </div>
    </div>
    <div class="box">
        <div class="fc">
            <div class="fl">我怀念的,是无话不说</div>
            <div class="fr del">删除</div>
        </div>
    </div>
    <div class="box">
        <div class="fc">
            <div class="fl">我怀念的,是无话不说</div>
            <div class="fr del">删除</div>
        </div>
    </div><div class="box">
        <div class="fc">
            <div class="fl">我怀念的,是无话不说</div>
            <div class="fr del">删除</div>
        </div>
    </div>
    <div class="box">
        <div class="fc">
            <div class="fl">我怀念的,是无话不说</div>
            <div class="fr del">删除</div>
        </div>
    </div>
    
    </body>
    <script type="text/javascript" src="js/jQuery1.7.js"></script>
    <script>
    $(document).ready(function(){
     $(".del").click(function(){
        $(this).parents(".box").remove();
     })
    
    })
    </script>
    
    </html>
  • 相关阅读:
    Live2d Test Env
    关于word2vec的一些问题
    排序链表
    最长回文子串
    前缀树
    验证回文串
    最大子序和/积
    构建知识图谱-初学
    HMM-维特比算法理解与实现(python)
    跨存储后台迁移数据的三种方案
  • 原文地址:https://www.cnblogs.com/fkcqwq/p/6281933.html
Copyright © 2011-2022 走看看