4-29 js DOM基础知识

// document.getElementById("xx") id获取名字 $(#xx)
            // document.getElementsByTagName(xx) 获取标签 $("xx")
            // document.getElementsByClassName(xx) 获取class $("xx")
            // document.getElementById().innerHTML = newhtml; 改变元素$("#div").html 
            // document.getElementById().setAttribute(attr.va;) 改变属性 
            // document.getElementById().style.PropertyPriority改变样式("#.div").attr()
            // ("#.div").css()
            //  document.getElementById(‘id’).appendChild(p); 
            //  document.removeChild(element); 删除元素
            //  document.replaceChild(newnode,oldnode);替换元素
            //  document.getElementById(id).onclick = function(){code}; 点击事件

posted on 2020-04-29 16:26  vermouthmo  阅读(114)  评论(0)    收藏  举报

导航