问答详情
源自:3-1 使用JS实现删除分享功能

JS源码

/**
 * Created by Administrator on 2014/12/10.
 */
window.onload=function(){
    var list=document.getElementById("list");
    var lis=list.childNodes;

    function re(node){
        node.parentNode.removeChild(node);
    }

    for(i=0;i<lis.length;i++){
        lis[i].onclick=function(e){
            e=e||window.event;
            var el= e.srcElement;
            switch(el.className){
                case 'close':
                    re(el.parentNode);
                    break;
            }
        }
    }
}

提问者:shadowpj 2014-12-10 15:29

个回答

  • ylbisno1
    2016-02-26 21:21:30

    哪里错误怎么不标注