`
gllwhq
  • 浏览: 14774 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

js遍历

 
阅读更多
if (child.className == "pinglundiv" && click.className == "pl") {
child.style.display = "table-cell";
var t = child.getElementsByTagName("form");
var mywordVlue = t[0]["myword1"].value;
t[0]["myword1"].parentNode.parentNode.style.display="block";
t[0]["myword1"].focus();



document.getElementById:

根据id获取页面dom元素节点

parentNode:

获取元素的父元素节点

.style.display:

设置元素的display样式

元素display为none为不可见
inline为行内模式
block为块模式



空字符串为默认,比如div默认是block,span默认是inline
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics