About nextSibling, IEnextSibling in IE

Source: Internet
Author: User

About nextSibling, IEnextSibling in IE

<Script> var shq = {} shq. cmenu = function (e) {var e = window. event? Window. event. srcElement: e.tar get; if (/a/I. test (e. tagName) {alert (e. parentNode. nextSibling. nodeType); // 3 text e. parentNode. nextSibling. innerHTML = e. innerHTML; e. blur () ;}</script> <div id = "div1" onclick = "shq. cmenu (event) "> <a href =" # "> features </a> </div> <div id =" div2 "> </div>

System Environment: win8, ie11

Problem: nextSibling fails to get the next node of the current node at the same level.

Process description: When you click [feature], the innerHtml of div2 is not [feature]
During debugging, we found that e. parentNode. nextSibling is not the next div but # text, and nodetype is equal to 3.

My personal conclusion: I don't know, right? The result is as follows.

Div1.nextSibling. nextSibling is div2.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.