码迷,mamicode.com
首页 > 编程语言 > 详细

常用Javascript集锦【不定期更新】

时间:2017-09-20 19:39:03      阅读:225      评论:0      收藏:0      [点我收藏+]

标签:isp   node   rem   ntb   nod   name   element   classname   移除   

怎样用javascript删除某个HEML标签

document.getElementById(id).parentNode.removeChild(document.getElementById(id));

javascript之html元素文本输出

document.getElementById("demo").innerHTML="hello world";

怎样通过标签为元素添加属性

document.getElementsByTagName("body")[0].setAttribute("type","text")

怎样移除元素某个属性

document.getElementsByClassName(‘marketingPlanLeft‘)[0].removeAttribute(‘style‘);

设置元素可见

document.getElementsByClassName(‘goOnShopping‘)[0].style.display=‘block‘;
document.getElementById(‘‘).style.diplay=‘block‘;

 

常用Javascript集锦【不定期更新】

标签:isp   node   rem   ntb   nod   name   element   classname   移除   

原文地址:http://www.cnblogs.com/longronglang/p/7562881.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!