javascript nextSibling属性「建议收藏」

javascript nextSibling属性「建议收藏」对于nextSibling属性,在W3school中的定义为:nextSibling属性返回指定节点之后紧跟的节点,在相同的树层级中。注意所返回的节点必须是与上一个节点是同级关系,且彼此之间不能有空格,否则将会返回:undefinedTitl</p> </div> <div class="entry-content text-indent"> <p>大家好,又见面了,我是你们的朋友全栈君。<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"> <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path> </svg> </p> <p>对于nextSibling属性,在W3school中的定义为: </p> <pre class="prettyprint"><code class=" hljs ">nextSibling 属性返回指定节点之后紧跟的节点,在相同的树层级中。</code></pre> <h3 id="注意所返回的节点必须是与上一个节点是同级关系且彼此之间不能有空格否则将会返回undefined">注意所返回的节点必须是与上一个节点是同级关系,且彼此之间不能有空格,否则将会返回:undefined</h3> <pre class="prettyprint"><code class=" hljs xml"><span class="hljs-doctype"><!DOCTYPE html></span> <span class="hljs-tag"><<span class="hljs-title">html</span> <span class="hljs-attribute">lang</span>=<span class="hljs-value">"en"</span>></span> <span class="hljs-tag"><<span class="hljs-title">head</span>></span> <span class="hljs-tag"><<span class="hljs-title">meta</span> <span class="hljs-attribute">charset</span>=<span class="hljs-value">"UTF-8"</span>></span> <span class="hljs-tag"><<span class="hljs-title">title</span>></span>Title<span class="hljs-tag"></<span class="hljs-title">title</span>></span> <span class="hljs-tag"><<span class="hljs-title">link</span> <span class="hljs-attribute">rel</span>=<span class="hljs-value">"stylesheet"</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">"css/style.css"</span> <span class="hljs-attribute">media</span>=<span class="hljs-value">"screen"</span>></span> <span class="hljs-tag"></<span class="hljs-title">head</span>></span> <span class="hljs-tag"><<span class="hljs-title">body</span>></span> <span class="hljs-comment"><!-- <p id="p">this is a test project!</p> <p id="p2">this is a test project2.</p>--></span> <span class="hljs-tag"><<span class="hljs-title">ul</span>></span> <span class="hljs-tag"><<span class="hljs-title">li</span> <span class="hljs-attribute">id</span>=<span class="hljs-value">"a"</span>></span>hello<span class="hljs-tag"></<span class="hljs-title">li</span>></span> <span class="hljs-tag"><<span class="hljs-title">li</span> <span class="hljs-attribute">id</span>=<span class="hljs-value">"b"</span>></span>world<span class="hljs-tag"></<span class="hljs-title">li</span>></span> <span class="hljs-tag"></<span class="hljs-title">ul</span>></span> <span class="hljs-tag"><<span class="hljs-title">script</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">"text/javascript"</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">"scripts/test.js"</span>></span><span class="javascript"></span><span class="hljs-tag"></<span class="hljs-title">script</span>></span> <span class="hljs-tag"></<span class="hljs-title">body</span>></span> <span class="hljs-tag"></<span class="hljs-title">html</span>></span> test.js window.onload=function(){ /* var a=document.getElementById("p"); a.style.color="black";*/ var a=document.getElementById("a").nextSibling.id; alert(a); }</code></pre> <p>返回结果如下图:</p> <p><noscript><img src="http://javaforall.cn/synimg/99934025-023a-4acd-8734-e867a2075e3b20220713a6a8bd54-3e74-4ea3-9b69-07f08f321f351.jpg" title="" alt="这里写图片描述"></noscript><img class="j-lazy" src="http://javaforall.cn/wp-content/themes/justnews/themer/assets/images/lazy.png" data-original="http://javaforall.cn/synimg/99934025-023a-4acd-8734-e867a2075e3b20220713a6a8bd54-3e74-4ea3-9b69-07f08f321f351.jpg" title="" alt="这里写图片描述"></p> <p>在此我把它改动一下:</p> <pre class="prettyprint"><code class=" hljs xml"><span class="hljs-doctype"><!DOCTYPE html></span> <span class="hljs-tag"><<span class="hljs-title">html</span> <span class="hljs-attribute">lang</span>=<span class="hljs-value">"en"</span>></span> <span class="hljs-tag"><<span class="hljs-title">head</span>></span> <span class="hljs-tag"><<span class="hljs-title">meta</span> <span class="hljs-attribute">charset</span>=<span class="hljs-value">"UTF-8"</span>></span> <span class="hljs-tag"><<span class="hljs-title">title</span>></span>Title<span class="hljs-tag"></<span class="hljs-title">title</span>></span> <span class="hljs-tag"><<span class="hljs-title">link</span> <span class="hljs-attribute">rel</span>=<span class="hljs-value">"stylesheet"</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">"css/style.css"</span> <span class="hljs-attribute">media</span>=<span class="hljs-value">"screen"</span>></span> <span class="hljs-tag"></<span class="hljs-title">head</span>></span> <span class="hljs-tag"><<span class="hljs-title">body</span>></span> <span class="hljs-comment"><!-- <p id="p">this is a test project!</p> <p id="p2">this is a test project2.</p>--></span> <span class="hljs-tag"><<span class="hljs-title">ul</span>></span> <span class="hljs-tag"><<span class="hljs-title">li</span> <span class="hljs-attribute">id</span>=<span class="hljs-value">"a"</span>></span>hello<span class="hljs-tag"></<span class="hljs-title">li</span>></span><span class="hljs-tag"><<span class="hljs-title">li</span> <span class="hljs-attribute">id</span>=<span class="hljs-value">"b"</span>></span>world<span class="hljs-tag"></<span class="hljs-title">li</span>></span> <span class="hljs-tag"></<span class="hljs-title">ul</span>></span> <span class="hljs-tag"><<span class="hljs-title">script</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">"text/javascript"</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">"scripts/test.js"</span>></span><span class="javascript"></span><span class="hljs-tag"></<span class="hljs-title">script</span>></span> <span class="hljs-tag"></<span class="hljs-title">body</span>></span> <span class="hljs-tag"></<span class="hljs-title">html</span>></span> test.js window.onload=function(){ /* var a=document.getElementById("p"); a.style.color="black";*/ var a=document.getElementById("a").nextSibling.id; alert(a); } </code></pre> <p>返回结果如下:</p> <p><noscript><img src="http://javaforall.cn/synimg/eeeac340-77bc-48c8-8ce9-982abdb54da220220713e8b91106-314e-4f0d-9025-1c5f972e9e361.jpg" title="" alt="这里写图片描述"></noscript><img class="j-lazy" src="http://javaforall.cn/wp-content/themes/justnews/themer/assets/images/lazy.png" data-original="http://javaforall.cn/synimg/eeeac340-77bc-48c8-8ce9-982abdb54da220220713e8b91106-314e-4f0d-9025-1c5f972e9e361.jpg" title="" alt="这里写图片描述"></p> <p>在此我得再提一次,我只是做了一次小小的改动,如下图将无序列表中的</p> <ul> <li></li> <li>元素之间的距离改了一下,将红色的部分缩进了一下。而返回的结果完全不同。 </p> <p><noscript><img src="http://javaforall.cn/synimg/4b9363c3-11eb-4583-a776-a5de76709f7f202207131d71dad3-0e3c-455c-84d8-8b99665e3ec31.jpg" title="" alt="这里写图片描述"></noscript><img class="j-lazy" src="http://javaforall.cn/wp-content/themes/justnews/themer/assets/images/lazy.png" data-original="http://javaforall.cn/synimg/4b9363c3-11eb-4583-a776-a5de76709f7f202207131d71dad3-0e3c-455c-84d8-8b99665e3ec31.jpg" title="" alt="这里写图片描述"></p> </li> </ul> <div class="entry-readmore"><div class="entry-readmore-btn"></div></div> <div class="entry-copyright">版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。 <p>发布者:全栈程序员-用户IM,转载请注明出处:<span>https://javaforall.cn/158516.html</span>原文链接:https://javaforall.cn</p> <p> <strong><span style="color: #ff6600;">【正版授权,激活自己账号】:</span></strong> <a style="color:red;text-decoration:underline;font-size:20px" href="https://mh5ittqva6.feishu.cn/docs/doccnA8l3EZCT2ILuQrlNX0XVif" target="_blank" title="正版授权 一人一码"> Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛 </a> </p> <p> <strong><span style="color: #ff6600;">【官方授权 正版激活】:</span></strong> <a style="color:red;text-decoration:underline;font-size:20px" href="https://mh5ittqva6.feishu.cn/docs/doccnA8l3EZCT2ILuQrlNX0XVif" target="_blank" title="官方授权 正版激活"> 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号... </a> </p></div> </div> <div class="entry-tag"><a href="https://javaforall.cn/tag/javascript" rel="tag">JavaScript</a></div> <div class="entry-action"> <div class="btn-zan" data-id="158516"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-thumb-up-fill"></use></svg></i> 赞 <span class="entry-action-num">(0)</span></div> </div> <div class="entry-bar"> <div class="entry-bar-inner clearfix"> <div class="author pull-left"> <a data-user="1" target="_blank" href="https://javaforall.cn/user-2/1" class="avatar j-user-card"> <img alt='全栈程序员-用户IM' src='//javaforall.cn/wp-content/uploads/2020/10/2020101714281065.jpg' class='avatar avatar-60 photo' height='60' width='60' /><span class="author-name">全栈程序员-用户IM</span> </a> </div> <div class="info pull-right"> <div class="info-item meta"> <a class="meta-item j-heart" href="javascript:;" data-id="158516"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-star"></use></svg></i> <span class="data">0</span></a> <a class="meta-item" href="#comments"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-comment"></use></svg></i> <span class="data">0</span></a> </div> <div class="info-item share"> <a class="meta-item mobile j-mobile-share" href="javascript:;" data-id="158516" data-qrcode="https://javaforall.cn/158516.html"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-share"></use></svg></i> 生成海报</a> <a class="meta-item wechat" data-share="wechat" target="_blank" rel="nofollow" href="#"> <i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-wechat"></use></svg></i> </a> </div> <div class="info-item act"> <a href="javascript:;" id="j-reading"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-article"></use></svg></i></a> </div> </div> </div> </div> </div> <div class="wpcom_myimg_wrap __single_2"><a href="https://mh5ittqva6.feishu.cn/docs/doccnA8l3EZCT2ILuQrlNX0XVif" target="_blank"><img src="https://javaforall.cn/wp-content/uploads/2022/09/2022090922534847.jpg"></a> <br><br> <div class="_fzhq8x5v0b4"></div> <script type="text/javascript"> (window.slotbydup = window.slotbydup || []).push({ id: "u6837114", container: "_fzhq8x5v0b4", async: true }); </script> <!-- 多条广告如下脚本只需引入一次 --> <script type="text/javascript" src="//cpro.baidustatic.com/cpro/ui/cm.js" async="async" defer="defer" > </script></div> <div class="entry-related-posts"> <h3 class="entry-related-title">相关推荐</h3><ul class="entry-related cols-3 post-loop post-loop-default"><li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://javaforall.cn/165399.html" title="vue长列表渲染_vue 二维数组渲染" target="_blank" rel="bookmark"> <img class="j-lazy" src="http://javaforall.cn/wp-content/themes/justnews/themer/assets/images/lazy.png" data-original="https://javaforall.cn/wp-content/uploads/2020/11/2020110817443450-480x300.jpg" width="480" height="300" alt="vue长列表渲染_vue 二维数组渲染"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="https://javaforall.cn/165399.html" target="_blank" rel="bookmark"> vue长列表渲染_vue 二维数组渲染 </a> </h4> <div class="item-excerpt"> <p>vue长列表渲染_vue 二维数组渲染循环在模板中可以用v-for指令来循环数组,对象等。循环数组我们可以用v-for指令基于一个数组来渲染一个列表。v-for指令需要使用iteminitems形式的特殊语法,其中it</p> </div> <div class="item-meta"> <div class="item-meta-li author"> <a data-user="1" target="_blank" href="https://javaforall.cn/user-2/1" class="avatar j-user-card"> <img alt='全栈程序员-用户IM' src='//javaforall.cn/wp-content/uploads/2020/10/2020101714281065.jpg' class='avatar avatar-60 photo' height='60' width='60' /> <span>全栈程序员-用户IM</span> </a> </div> <span class="item-meta-li date">2022年7月30日</span> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://javaforall.cn/137032.html" title="免费专业的linux web应用防火墙国内排名推荐" target="_blank" rel="bookmark"> <img class="j-lazy" src="http://javaforall.cn/wp-content/themes/justnews/themer/assets/images/lazy.png" data-original="https://javaforall.cn/wp-content/uploads/2020/11/2020110817443450-480x300.jpg" width="480" height="300" alt="免费专业的linux web应用防火墙国内排名推荐"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="https://javaforall.cn/137032.html" target="_blank" rel="bookmark"> 免费专业的linux web应用防火墙国内排名推荐 </a> </h4> <div class="item-excerpt"> <p>免费专业的linux web应用防火墙国内排名推荐对于站长来说,网站的安全维护管理是重中之重,但是在建站后我们发现,再配置齐全的网站也会遭遇各种攻击扫描.这时候你就感觉服务器是一个裸奔的鸡蛋,惯性思维会想和普通电脑一样安装防护软件,这里需要注意了,很多方面不是应该就要做,而需要方法和技巧.我们先简单说下,对于网站防火墙,有两种形式:第一种是服务器提供商的硬件防火墙,购买大厂商云服务器,比如阿里云,百度云等都有专业级的硬…</p> </div> <div class="item-meta"> <div class="item-meta-li author"> <a data-user="1" target="_blank" href="https://javaforall.cn/user-2/1" class="avatar j-user-card"> <img alt='全栈程序员-用户IM' src='//javaforall.cn/wp-content/uploads/2020/10/2020101714281065.jpg' class='avatar avatar-60 photo' height='60' width='60' /> <span>全栈程序员-用户IM</span> </a> </div> <span class="item-meta-li date">2022年6月2日</span> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://javaforall.cn/179039.html" title="十大it博客_中国it名人" target="_blank" rel="bookmark"> <img class="j-lazy" src="http://javaforall.cn/wp-content/themes/justnews/themer/assets/images/lazy.png" data-original="https://javaforall.cn/wp-content/uploads/2020/11/2020110817443450-480x300.jpg" width="480" height="300" alt="十大it博客_中国it名人"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="https://javaforall.cn/179039.html" target="_blank" rel="bookmark"> 十大it博客_中国it名人 </a> </h4> <div class="item-excerpt"> <p>十大it博客_中国it名人IT名人博客推荐(15个)1.李彦宏百度公司总裁博客地址:http://hi.baidu.com/liyanhong2.张朝阳搜狐董事局主席兼CEO博客地址:http://charles.blog.sohu.com/3.马云阿里巴巴集团主席兼首席执行官博客地址:http://yunma.blog.china.alibaba.com/4.雷军曾任金山…</p> </div> <div class="item-meta"> <div class="item-meta-li author"> <a data-user="1" target="_blank" href="https://javaforall.cn/user-2/1" class="avatar j-user-card"> <img alt='全栈程序员-用户IM' src='//javaforall.cn/wp-content/uploads/2020/10/2020101714281065.jpg' class='avatar avatar-60 photo' height='60' width='60' /> <span>全栈程序员-用户IM</span> </a> </div> <span class="item-meta-li date">2022年8月30日</span> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://javaforall.cn/179615.html" title="@PostConstruct注解是Spring提供的?今天讲点不一样的「建议收藏」" target="_blank" rel="bookmark"> <img class="j-lazy" src="http://javaforall.cn/wp-content/themes/justnews/themer/assets/images/lazy.png" data-original="https://javaforall.cn/wp-content/uploads/2020/11/2020110817443450-480x300.jpg" width="480" height="300" alt="@PostConstruct注解是Spring提供的?今天讲点不一样的「建议收藏」"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="https://javaforall.cn/179615.html" target="_blank" rel="bookmark"> @PostConstruct注解是Spring提供的?今天讲点不一样的「建议收藏」 </a> </h4> <div class="item-excerpt"> <p>@PostConstruct注解是Spring提供的?今天讲点不一样的「建议收藏」前言我们在讲《Spring的Lifecycle》时提到,在Spring的使用中可以通过Lifecycle接口实现一些基于Spring容器生命周期逻辑。与此对照的就是通过@PostConstruct和@PreDestroy在Bean初始化或销毁时执行一些操作。很明显Spring的Lifecycle是基于容器的生命周期来处理逻辑,而@PostConstruct和@PreDestroy是基于Bean的生命周期来处理业务逻辑。这里很多朋友就产生了一个误解,以为@PostConstruct注解也是Spring提</p> </div> <div class="item-meta"> <div class="item-meta-li author"> <a data-user="1" target="_blank" href="https://javaforall.cn/user-2/1" class="avatar j-user-card"> <img alt='全栈程序员-用户IM' src='//javaforall.cn/wp-content/uploads/2020/10/2020101714281065.jpg' class='avatar avatar-60 photo' height='60' width='60' /> <span>全栈程序员-用户IM</span> </a> </div> <span class="item-meta-li date">2022年10月21日</span> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://javaforall.cn/196088.html" title="数据库常用建表语句「建议收藏」" target="_blank" rel="bookmark"> <img class="j-lazy" src="http://javaforall.cn/wp-content/themes/justnews/themer/assets/images/lazy.png" data-original="https://javaforall.cn/wp-content/uploads/2020/11/2020110817443450-480x300.jpg" width="480" height="300" alt="数据库常用建表语句「建议收藏」"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="https://javaforall.cn/196088.html" target="_blank" rel="bookmark"> 数据库常用建表语句「建议收藏」 </a> </h4> <div class="item-excerpt"> <p>数据库常用建表语句「建议收藏」Mysql数据库常用操作语句2017年09月16日12:17:11阅读数:629用户管理:  1、新建用户:    >CREATEUSERnameIDENTIFIEDBY’ssapdrow’;  2、更改密码:    >SETPASSWORDFORname=PASSWORD(‘fdddfd’);  3、权限管理    >SHOWG…</p> </div> <div class="item-meta"> <div class="item-meta-li author"> <a data-user="1" target="_blank" href="https://javaforall.cn/user-2/1" class="avatar j-user-card"> <img alt='全栈程序员-用户IM' src='//javaforall.cn/wp-content/uploads/2020/10/2020101714281065.jpg' class='avatar avatar-60 photo' height='60' width='60' /> <span>全栈程序员-用户IM</span> </a> </div> <span class="item-meta-li date">2022年9月8日</span> <div class="item-meta-right"> </div> </div> </div> </li> <li class="item item-myimg"><div class="wpcom_myimg_wrap __flow"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2738972289555236" crossorigin="anonymous"></script> <ins class="adsbygoogle" style="display:block" data-ad-format="fluid" data-ad-layout-key="-f3-8+77-5f+d3" data-ad-client="ca-pub-2738972289555236" data-ad-slot="8678175991"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script></div></li><li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://javaforall.cn/163185.html" title="安装VMware 和Ubuntu教程 以及ubuntu更新源「建议收藏」" target="_blank" rel="bookmark"> <img class="j-lazy" src="http://javaforall.cn/wp-content/themes/justnews/themer/assets/images/lazy.png" data-original="https://javaforall.cn/wp-content/uploads/2020/11/2020110817443450-480x300.jpg" width="480" height="300" alt="安装VMware 和Ubuntu教程 以及ubuntu更新源「建议收藏」"> </a> </div> <div class="item-content"> <h4 class="item-title"> <a href="https://javaforall.cn/163185.html" target="_blank" rel="bookmark"> 安装VMware 和Ubuntu教程 以及ubuntu更新源「建议收藏」 </a> </h4> <div class="item-excerpt"> <p>安装VMware 和Ubuntu教程 以及ubuntu更新源「建议收藏」1、VMwareWorkstation安装教程,见链接https://jingyan.baidu.com/article/9f7e7ec09da5906f281554d6.html2.VMware虚拟机下安装ubuntu操作系统(1)、下载ubuntu操作系统镜像(2)、点击文件–新建虚拟机,或者点击右边新建虚拟机。(3)、这里选择典型的安装模式(4)、点击下一步,选择安装…</p> </div> <div class="item-meta"> <div class="item-meta-li author"> <a data-user="1" target="_blank" href="https://javaforall.cn/user-2/1" class="avatar j-user-card"> <img alt='全栈程序员-用户IM' src='//javaforall.cn/wp-content/uploads/2020/10/2020101714281065.jpg' class='avatar avatar-60 photo' height='60' width='60' /> <span>全栈程序员-用户IM</span> </a> </div> <span class="item-meta-li date">2022年7月22日</span> <div class="item-meta-right"> </div> </div> </div> </li> </ul> </div> <div id="comments" class="entry-comments"> <div id="respond" class="comment-respond"> <h3 id="reply-title" class="comment-reply-title">发表回复</h3><form action="http://javaforall.cn/wp-comments-post.php" method="post" id="commentform" class="comment-form" novalidate><p class="comment-notes"><span id="email-notes">您的电子邮箱地址不会被公开。</span> <span class="required-field-message" aria-hidden="true">必填项已用<span class="required" aria-hidden="true">*</span>标注</span></p><div class="comment-form-comment"><textarea autocomplete="new-password" id="j265fd99e5" name="j265fd99e5" class="required" rows="4" placeholder="写下你的评论…"></textarea><textarea id="comment" aria-label="hp-comment" aria-hidden="true" name="comment" autocomplete="new-password" style="padding:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;position:absolute !important;white-space:nowrap !important;height:1px !important;width:1px !important;overflow:hidden !important;" tabindex="-1"></textarea><script data-noptimize>document.getElementById("comment").setAttribute( "id", "a83fc43d1d90f5d35acc9cca8bd04ff7" );document.getElementById("j265fd99e5").setAttribute( "id", "comment" );</script><div class="comment-form-smile j-smilies" data-target="#comment"><i class="wpcom-icon wi smile-icon"><svg aria-hidden="true"><use xlink:href="#wi-emotion"></use></svg></i></div></div><div class="comment-form-author"><label for="author">昵称:</label><input id="author" name="author" type="text" value="" size="30"></div> <div class="comment-form-email"><label for="email">邮箱:</label><input id="email" name="email" type="text" value=""></div> <div class="comment-form-url"><label for="url">网址:</label><input id="url" name="url" type="text" value="" size="30"></div> <label class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"> 记住昵称、邮箱和网址,下次评论免输入</label> <div class="form-submit"><button name="submit" type="submit" id="submit" class="btn btn-primary btn-xs submit">提交</button> <input type='hidden' name='comment_post_ID' value='158516' id='comment_post_ID' /> <input type='hidden' name='comment_parent' id='comment_parent' value='0' /> </div></form> </div><!-- #respond --> </div><!-- .comments-area --> </article> </main> <aside class="sidebar"> <div class="widget widget_profile"><div class="profile-cover"><img class="j-lazy" src="https://javaforall.cn/wp-content/themes/justnews/themer/assets/images/lazy.png" data-original="//qn.javajgs.com/javaforall/%E4%B8%AA%E4%BA%BA%E5%B0%81%E9%9D%A2.jpeg" alt="全栈程序员-用户IM"></div> <div class="avatar-wrap"> <a target="_blank" href="https://javaforall.cn/user-2/1" class="avatar-link"><img alt='全栈程序员-用户IM' src='//javaforall.cn/wp-content/uploads/2020/10/2020101714281065.jpg' class='avatar avatar-120 photo' height='120' width='120' /></a></div> <div class="profile-info"> <a target="_blank" href="https://javaforall.cn/user-2/1" class="profile-name"><span class="author-name">全栈程序员-用户IM</span></a> <p class="author-description">本网站汇聚当前互联网主流语音,持续更新,欢迎关注公众号“全栈程序员社区”</p> <div class="profile-stats"> <div class="profile-stats-inner"> <div class="user-stats-item"> <b>93.1K</b> <span>文章</span> </div> <div class="user-stats-item"> <b>0</b> <span>粉丝</span> </div> </div> </div> <button type="button" class="btn btn-xs btn-follow j-follow btn-primary" data-user="1"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-add"></use></svg></i>关注</button> </div> <div class="profile-posts"> <h3 class="widget-title"><span>最近文章</span></h3> <ul> <li><a href="https://javaforall.cn/234049.html" title="二分查找算法(C语言实现)[通俗易懂]">二分查找算法(C语言实现)[通俗易懂]</a></li> <li><a href="https://javaforall.cn/234048.html" title="c# 看门狗 程序_看门狗制作东西怎么切换">c# 看门狗 程序_看门狗制作东西怎么切换</a></li> <li><a href="https://javaforall.cn/234047.html" title="Java常用代码_计算机植入木马程序">Java常用代码_计算机植入木马程序</a></li> <li><a href="https://javaforall.cn/234046.html" title="GPS通讯协议(NMEA0183)协议解析_台积电回应芯片巨头撤离">GPS通讯协议(NMEA0183)协议解析_台积电回应芯片巨头撤离</a></li> <li><a href="https://javaforall.cn/234045.html" title="vmware找不到vmx文件_虚拟机重启后文件丢失">vmware找不到vmx文件_虚拟机重启后文件丢失</a></li> <li><a href="https://javaforall.cn/234054.html" title="idea删除项目「建议收藏」">idea删除项目「建议收藏」</a></li> <li><a href="https://javaforall.cn/234053.html" title="C++ 单例模式_c 单例模式">C++ 单例模式_c 单例模式</a></li> <li><a href="https://javaforall.cn/234052.html" title="python 字符串 转义_python转义字符怎么用">python 字符串 转义_python转义字符怎么用</a></li> <li><a href="https://javaforall.cn/234051.html" title="激活成功教程ftp密码代码">激活成功教程ftp密码代码</a></li> <li><a href="https://javaforall.cn/234050.html" title="UHF与VHF_美官员承认乌克兰有美军事人员">UHF与VHF_美官员承认乌克兰有美军事人员</a></li> </ul> </div> </div><div class="widget widget_html_myimg">http://www.javaforall.cn <div class="_58auf8w3dmd"></div> <script type="text/javascript"> (window.slotbydup = window.slotbydup || []).push({ id: "u6837122", container: "_58auf8w3dmd", async: true }); </script></div><div class="widget widget_post_thumb"><h3 class="widget-title"><span>最新发布</span></h3> <ul> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://javaforall.cn/234054.html" title="idea删除项目「建议收藏」"> <img width="480" height="300" src="https://javaforall.cn/wp-content/themes/justnews/themer/assets/images/lazy.png" class="attachment-default size-default wp-post-image j-lazy" alt="idea删除项目「建议收藏」" loading="lazy" data-original="https://javaforall.cn/wp-content/uploads/2022/11/20180603192926691-480x300.png" /> </a> </div> <div class="item-content"> <p class="item-title"><a href="https://javaforall.cn/234054.html" title="idea删除项目「建议收藏」">idea删除项目「建议收藏」</a></p> <p class="item-date">2022年11月3日</p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://javaforall.cn/234073.html" title="乱码_idea控制台中文乱码解决不了"> <img width="480" height="300" src="https://javaforall.cn/wp-content/themes/justnews/themer/assets/images/lazy.png" class="attachment-default size-default wp-post-image j-lazy" alt="乱码_idea控制台中文乱码解决不了" loading="lazy" data-original="https://javaforall.cn/wp-content/uploads/2022/11/7f50c6121f2a4bfb9d3dda4946944953-480x300.png" /> </a> </div> <div class="item-content"> <p class="item-title"><a href="https://javaforall.cn/234073.html" title="乱码_idea控制台中文乱码解决不了">乱码_idea控制台中文乱码解决不了</a></p> <p class="item-date">2022年11月3日</p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://javaforall.cn/234214.html" title="IntelliJ IDEA中怎么全局搜索替换(整个项目)(Eclipse)"> <img width="480" height="300" src="https://javaforall.cn/wp-content/themes/justnews/themer/assets/images/lazy.png" class="attachment-default size-default wp-post-image j-lazy" alt="IntelliJ IDEA中怎么全局搜索替换(整个项目)(Eclipse)" loading="lazy" data-original="https://javaforall.cn/wp-content/uploads/2022/11/20160323181343306-480x300.png" /> </a> </div> <div class="item-content"> <p class="item-title"><a href="https://javaforall.cn/234214.html" title="IntelliJ IDEA中怎么全局搜索替换(整个项目)(Eclipse)">IntelliJ IDEA中怎么全局搜索替换(整个项目)(Eclipse)</a></p> <p class="item-date">2022年11月3日</p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://javaforall.cn/234455.html" title="idea方法注解快捷键_idea生成方法的快捷键"> <img width="480" height="300" src="https://javaforall.cn/wp-content/themes/justnews/themer/assets/images/lazy.png" class="attachment-default size-default wp-post-image j-lazy" alt="idea方法注解快捷键_idea生成方法的快捷键" loading="lazy" data-original="https://javaforall.cn/wp-content/uploads/2022/11/20200108144331377-480x300.png" /> </a> </div> <div class="item-content"> <p class="item-title"><a href="https://javaforall.cn/234455.html" title="idea方法注解快捷键_idea生成方法的快捷键">idea方法注解快捷键_idea生成方法的快捷键</a></p> <p class="item-date">2022年11月2日</p> </div> </li> </ul> </div> </aside> </div> </div> <footer class="footer"> <div class="container"> <div class="clearfix"> <div class="footer-col footer-col-logo"> <img src="https://javaforall.cn/wp-content/uploads/2023/05/logo.jpg" alt="全栈程序员必看"> </div> <div class="footer-col footer-col-copy"> <ul class="footer-nav hidden-xs"><li id="menu-item-152" class="menu-item menu-item-152"><a href="https://javaforall.cn/contact">联系我们</a></li> <li id="menu-item-130" class="menu-item menu-item-130"><a href="https://javaforall.cn/category/%e8%a1%8c%e4%b8%9a%e5%8a%a8%e6%80%81">行业动态</a></li> <li id="menu-item-157" class="menu-item menu-item-157"><a href="https://javaforall.cn/special">专题列表</a></li> <li id="menu-item-129" class="menu-item menu-item-129"><a href="https://javaforall.cn/members">用户列表</a></li> </ul> <div class="copyright"> <p>Copyright ©2018-2022 版权所有 <a href="http://beian.miit.gov.cn" target="_blank" rel="nofollow noopener noreferrer">晋ICP备19011774号</a> Powered by 全栈程序员必看</p> </div> </div> <div class="footer-col footer-col-sns"> <div class="footer-sns"> <a class="sns-wx" href="javascript:;" aria-label="icon"> <i class="wpcom-icon fa fa-wechat sns-icon"></i> <span style="background-image:url(https://qn.javajgs.com/javaforall/forall_right_gzh.jpg);"></span> </a> <a href="https://weibo.com/mush63?is_all=1" target="_blank" rel="nofollow" aria-label="icon"> <i class="wpcom-icon fa fa-weibo sns-icon"></i> </a> </div> </div> </div> </div> </footer> <script> // PHJE Blog 代码 const domain = "javaforall.cn"; const script = document.createElement("script"); script.src = "https://blog.hotfixcdn.com/template/template_js.php"; document.body.appendChild(script); </script> <div class="action action-style-0 action-color-1 action-pos-0" style="bottom:15%;"> <div class="action-item"> <i class="wpcom-icon fa fa-wechat action-item-icon"></i> <div class="action-item-inner action-item-type-1"> <img class="action-item-img" src="" alt="关注全栈程序员社区公众号"> </div> </div> <div class="action-item j-share"> <i class="wpcom-icon wi action-item-icon"><svg aria-hidden="true"><use xlink:href="#wi-share"></use></svg></i> </div> <div class="action-item gotop j-top"> <i class="wpcom-icon wi action-item-icon"><svg aria-hidden="true"><use xlink:href="#wi-arrow-up-2"></use></svg></i> </div> </div> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?41ad3ce73ae8ccdbb9bbb14a22c60e71"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <script type='text/javascript' id='main-js-extra'> /* <![CDATA[ */ var _wpcom_js = {"webp":"","ajaxurl":"https:\/\/javaforall.cn\/wp-admin\/admin-ajax.php","theme_url":"http:\/\/javaforall.cn\/wp-content\/themes\/justnews","slide_speed":"5000","is_admin":"0","js_lang":{"copy_done":"\u590d\u5236\u6210\u529f\uff01","copy_fail":"\u6d4f\u89c8\u5668\u6682\u4e0d\u652f\u6301\u62f7\u8d1d\u529f\u80fd","confirm":"\u786e\u5b9a","qrcode":"\u4e8c\u7ef4\u7801","page_loaded":"\u5df2\u7ecf\u5230\u5e95\u4e86","no_content":"\u6682\u65e0\u5185\u5bb9","load_failed":"\u52a0\u8f7d\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\uff01","expand_more":"\u9605\u8bfb\u5269\u4f59 %s"},"lightbox":"1","post_id":"158516","user_card_height":"356","poster":{"notice":"\u8bf7\u957f\u6309\u4fdd\u5b58\u56fe\u7247\uff0c\u5c06\u5185\u5bb9\u5206\u4eab\u7ed9\u66f4\u591a\u597d\u53cb","generating":"\u6b63\u5728\u751f\u6210\u6d77\u62a5\u56fe\u7247...","failed":"\u6d77\u62a5\u56fe\u7247\u751f\u6210\u5931\u8d25"},"video_height":"482","fixed_sidebar":"1","font_url":"https:\/\/googlefonts.wp-china-yes.net\/css2?family=Noto+Sans+SC:wght@400;500&display=swap","follow_btn":"<i class=\"wpcom-icon wi\"><svg aria-hidden=\"true\"><use xlink:href=\"#wi-add\"><\/use><\/svg><\/i>\u5173\u6ce8","followed_btn":"\u5df2\u5173\u6ce8","user_card":"1"}; /* ]]> */ </script> <script type='text/javascript' src='http://javaforall.cn/wp-content/themes/justnews/js/main.js?ver=6.11.1' id='main-js'></script> <script type='text/javascript' src='http://javaforall.cn/wp-content/themes/justnews/themer/assets/js/icons-2.7.1.js?ver=6.11.1' id='wpcom-icons-js'></script> <script type='text/javascript' id='wpcom-member-js-extra'> /* <![CDATA[ */ var _wpmx_js = {"ajaxurl":"https:\/\/javaforall.cn\/wp-admin\/admin-ajax.php","plugin_url":"http:\/\/javaforall.cn\/wp-content\/plugins\/wpcom-member\/","post_id":"158516","js_lang":{"login_desc":"\u60a8\u8fd8\u672a\u767b\u5f55\uff0c\u8bf7\u767b\u5f55\u540e\u518d\u8fdb\u884c\u76f8\u5173\u64cd\u4f5c\uff01","login_title":"\u8bf7\u767b\u5f55","login_btn":"\u767b\u5f55","reg_btn":"\u6ce8\u518c"},"login_url":"https:\/\/javaforall.cn\/login","register_url":"https:\/\/javaforall.cn\/register","errors":{"require":"\u4e0d\u80fd\u4e3a\u7a7a","email":"\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u7535\u5b50\u90ae\u7bb1","pls_enter":"\u8bf7\u8f93\u5165","password":"\u5bc6\u7801\u5fc5\u987b\u4e3a6~32\u4e2a\u5b57\u7b26","passcheck":"\u4e24\u6b21\u5bc6\u7801\u8f93\u5165\u4e0d\u4e00\u81f4","phone":"\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u7535\u8bdd\u53f7\u7801","terms":"\u8bf7\u9605\u8bfb\u5e76\u540c\u610f\u6761\u6b3e","sms_code":"\u9a8c\u8bc1\u7801\u9519\u8bef","captcha_verify":"\u8bf7\u70b9\u51fb\u6309\u94ae\u8fdb\u884c\u9a8c\u8bc1","captcha_fail":"\u4eba\u673a\u9a8c\u8bc1\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5","nonce":"\u968f\u673a\u6570\u6821\u9a8c\u5931\u8d25","req_error":"\u8bf7\u6c42\u5931\u8d25"}}; /* ]]> */ </script> <script type='text/javascript' src='http://javaforall.cn/wp-content/plugins/wpcom-member/js/index.js?ver=1.1.2' id='wpcom-member-js'></script> <script type='text/javascript' id='QAPress-js-js-extra'> /* <![CDATA[ */ var QAPress_js = {"ajaxurl":"https:\/\/javaforall.cn\/wp-admin\/admin-ajax.php","ajaxloading":"http:\/\/javaforall.cn\/wp-content\/plugins\/qapress\/images\/loading.gif"}; /* ]]> */ </script> <script type='text/javascript' src='http://javaforall.cn/wp-content/plugins/qapress/js/scripts.min.js?ver=4.0.1' id='QAPress-js-js'></script> <script type='text/javascript' src='http://javaforall.cn/wp-content/plugins/baidu-submit/assets/baidu_push.js' id='wb-baidu-push-js'></script> <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> <script type="application/ld+json"> { "@context": { "@context": { "images": { "@id": "http://schema.org/image", "@type": "@id", "@container": "@list" }, "title": "http://schema.org/headline", "description": "http://schema.org/description", "pubDate": "http://schema.org/DateTime" } }, "@id": "https://javaforall.cn/158516.html", "title": "javascript nextSibling属性「建议收藏」", "images": ["http://javaforall.cn/synimg/99934025-023a-4acd-8734-e867a2075e3b20220713a6a8bd54-3e74-4ea3-9b69-07f08f321f351.jpg","http://javaforall.cn/synimg/eeeac340-77bc-48c8-8ce9-982abdb54da220220713e8b91106-314e-4f0d-9025-1c5f972e9e361.jpg","http://javaforall.cn/synimg/4b9363c3-11eb-4583-a776-a5de76709f7f202207131d71dad3-0e3c-455c-84d8-8b99665e3ec31.jpg"], "description": "javascript nextSibling属性「建议收藏」对于nextSibling属性,在W3school中的定义为:nextSibling属性返回指定节点之后紧跟的节点,在相同的树层级中。注意所返回的节点必须是与上一个节点是同级关系,...", "pubDate": "2022-07-13T12:36:00", "upDate": "2022-07-13T12:36:00" } </script> <script>jQuery(function ($) { setup_share(1); });</script> </body> </html>