搜索
您的当前位置:首页正文

jquery 动态添加元素,动态删除元素

来源:筏尚旅游网
    $('#input').change(function () {
            console.log($('#add'));
            value = this.value;
            if (this.value){
                $('#add').append("<a name='key' class='btn btn-success fa fa-close'>"+this.value+"</a>");
            }

        });
        $(document).on('click','a[name="key"]',function () {
            console.log('点击了');
            console.log(this);
            this.remove();
        });

 

因篇幅问题不能全部显示,请点此查看更多更全内容

Top