zoukankan      html  css  js  c++  java
  • 微博发布

    <!DOCTYPE html>
    <html>
    <head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
    ul{
    list-style-type: none;}
    *{margin:0;padding: 0;}
    .box {
    margin: 100px auto;
    600px;
    height: auto;
    border:1px solid #333;
    padding: 30px 0;
    }
    textarea {
    450px;
    resize: none; /*防止用户拖动 右下角*/
    }
    .box li {
    450px;
    line-height: 30px;
    border-bottom:1px dashed #ccc;
    margin-left: 80px;
    }
    .box li a {
    float: right;
    }
    </style>
     
    </head>
    <body>
    <div class="box">
    微博发布: <textarea name="" id="txt" cols="30" rows="10"></textarea> <button id="btn">发布</button>
    <ul id="u"></ul>   
    </div>

    </body>
    </html>
    <script src="../../public.js"></script>
    <script>
        $id("btn").onclick = function(){
            var str = $id("txt").value.trim();
            if( str.length == 0 ){
                return;
            }
            var oLi = create("li");
            oLi.innerHTML = str + "<a href='javascript:;' class='del'>删除</a>";
            $id("u").insertBefore( oLi , $id("u").children[0] );
            
            //找到类名类del的超链接标签
            var btnDel = document.getElementsByClassName("del");
            for( var i = 0 ; i < btnDel.length ; i++ ){
                btnDel[i].onclick = function(){
                    if( confirm("确定要删除么?") ){
                        //删除当前行
                        this.parentNode.remove();
                    }
                }
            }
        }
    </script>
  • 相关阅读:
    客户端相关知识学习(三)之Android原生与H5交互的实现
    客户端相关知识学习(二)之h5与原生app交互的原理
    nslookup基础用法
    十大渗透测试演练系统
    最新的windows xp sp3序列号(绝对可通过正版验证)
    Metasploit基础命令
    msf回退一步
    验证SMB登入
    Nmap使用指南(1)
    postgreSql基础命令及linux下postgreSql命令
  • 原文地址:https://www.cnblogs.com/tis100204/p/10319201.html
Copyright © 2011-2022 走看看