111
var ul = document.createElement('ul') var li = document.createElement('li') ul.appendChild(li) 修改标签的全部class ul.className = 'c1' //为ul添加一个class='c1' ul.className = 'c2' //修改ul的class为class='c2' 添加删除标签的某个class ul.classList.add('c2') //<ul class="c1 c2">…</ul> ul.classList.remove('c1') //<ul class="c2">…</ul> 对标签添加或修改样式 ul.style.width = '32px // <ul class="c2" style=" 32px;">…</ul> ul.style.background = '#eee' //<ul class="c2" style=" 32px; background: rgb(238, 238, 238);">…</ul> ul.style.removeProperty('width') //<ul class="c2" style="background: rgb(238, 238, 238);">…</ul>
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
d.className = 'd1' "d1" d <div class="d1"></div> d.className = 'd2' "d2" d <div class="d2"></div> d.classList.add('d3') undefined d <div class="d2 d3"></div> d.className = 'dd' "dd" d <div class="dd"></div> d.className = 'dd ddd' "dd ddd" d <div class="dd ddd"></div>
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
function Go(){var content = '欢迎老男孩';var first_chr = content[0];var sub = content.substring(1,content.lenth);content = sub + first_chr;}
function Action(){ setInterval('Go()',1000)}