首页 > 其他分享 >遍历dom节点

遍历dom节点

时间:2022-12-26 10:15:33浏览次数:34  
标签:style 遍历 obj form dom nextSibling next group 节点

 function selectOnchang(obj) {
            var selectedValue = obj.selectedIndex
            if (selectedValue == 0) {
                obj.parentNode.nextSibling.style.display = 'none'
                obj.parentNode.nextSibling.nextSibling.style.display = 'inline'
            }else if (selectedValue == 1) {
                obj.parentNode.nextSibling.style.display = 'inline'
                obj.parentNode.nextSibling.nextSibling.style.display = 'none'
            }
        }
 $("select[name='source_type']").each(function (index, item) {
                            $(this).val(data.cameras[index].source_type)
                            if (data.cameras[index].source_type == 0) {
                                $(this).parent('.form-group').next().hide()
                                $(this).parent('.form-group').next().next().show()
                            } else {
                                $(this).parent('.form-group').next().show()
                                $(this).parent('.form-group').next().next().hide()
                            }
                        })

 

标签:style,遍历,obj,form,dom,nextSibling,next,group,节点
From: https://www.cnblogs.com/ljingjing/p/17005070.html

相关文章

  • 几种数组遍历
    for(vari=0;i<arr.length;i++)普通遍历for(vari=0;long=arr.length,i<long;i++),这是使用临时变量将数组长度缓存,当数组长度较大时,这种遍历跟普通遍历才会有些明......
  • Cf 455A [Boredom]
    Cf455ABoredom题意:给出\(n\)个数字,从中选一个\(a_k\)删除,\(a_k\)为你获得的值,删除\(a_k\)后,如果数组里面有\(a_{k+1},a_{k-1}\)也会被删除,求获得值最大为......
  • BFS场景样例测试--层次遍历--用Java实现
    我们今天研究下层次便利用BFS来实现 首先确定数据结构/***二叉树数据结构节点*/publicclassTreeNode{intvalue;TreeNodeleft;TreeNoderi......
  • 创建设备节点
    创建设备节点创建设备文件的一般语法:   $mknod/dev/<device>[c|b]<major><minor>例如:   $mknod/dev/ttySAC0c464   $mknod/dev/hda1......
  • 有用的DOM遍历方法,你需要了解一下
    英文| https://levelup.gitconnected.com/useful-dom-traversal-methods-d2b55cf8e25c翻译|web前端开发(ID:web_qdkf)客户端JavaScript的主要用途是动态地处理网页。我们......
  • dom标签快捷键
    1<!--快速键入多个标签div*3[tab]-->2<divtab=""></div>3<divtab=""></div>4<divtab=""></div>5<!--带id和类名的标签div.name......
  • 论文解读()《Cross-Domain Few-Shot Graph Classification》
    论文信息论文标题:Cross-DomainFew-ShotGraphClassification论文作者:KavehHassani论文来源:AAAI2023论文地址:download 论文代码:download1Introduction  2Me......
  • [LeetCode] 790. Domino and Tromino Tiling
    Youhavetwotypesoftiles:a 2x1 dominoshapeandatrominoshape.Youmayrotatetheseshapes.Givenanintegern,return thenumberofwaystotilea......
  • CF1666K Kingdom Partition 题解
    题意给定\(n\)个点\(m\)条边的无向图,边有边权\(l\)。需要将点划分成\(A,B,C\)三个集合。\(A\)或\(B\)内部的边有\(2l\)的贡献,\(AC\)或\(BC\)之间的边有......
  • Go 快速入门指南 - range 遍历
    概述Go特有的一种的遍历结构。它可以遍历任何一个 ​​集合(字符串、数组、切片、Map、通道等)​​​。语法上类似主流编程语言中的 ​​foreach​​ 语句,但可以获得每次......