Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6152219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:53:00+00:00 2026-05-23T19:53:00+00:00

We are using jQuery 1.5.1 on the site that I’m working on. I recently

  • 0

We are using jQuery 1.5.1 on the site that I’m working on. I recently discovered a problem with my HTML in Internet Explorer 8

The problem is that ‘nodeIndex’ properties are inserted in the DOM, presumably by jQuery (see below for another StackOverflow question that mentions nodeIndex). The properties are not there in the page source — only in the DOM then inspecting it with IE8’s (awesome) developer tool.

The DOM in IE8:

<DIV nodeIndex="4">
  <B nodeIndex="1">bold</B>
  <BR nodeIndex="2">
  <I nodeIndex="3">italics</I>
  <BR nodeIndex="4">
  <U nodeIndex="5">underline</U>
  <BR nodeIndex="6">
</DIV>

The DOM in FF5 (and Chrome 12):

<div>
  <b>bold</b>
  <br>
  <i>italics</i>
  <br>
  <u>underline</u>
  <br>
</div>

The problem is that the DIV is the text of a forum post. If the user wants to quote the forum post, the html of the post is to be converted into BBCode (because older forum posts use BBCode tags for markup), with the formatting markup maintained, and copied to a textarea in which the user writes the text for the new forum post (including the quoted text).

Using JavaScript/jQuery it would be simple to replace html tags with their corresponding BBCode tags, but the addition of the nodeIndex property makes it necessary to add a regular expression replacement of the nodeIndex property, which seems like an ugly hack.

Can anyone tell me why the nodeIndex properties are added in IE8 (and IE7), and is it jQuery that adds them — and more importantly: Can I get rid of them in a better way than using a regular expression replacement?

The site I work on uses a bunch of different JavaScript/jQuery scripts so there might be a conflict or at least some unexpected behavior that is a result of the combination of scripts.

Edit: The properties are not there when JavaScript is disabled in IE.

Other StackOverflow question that mentions nodeIndex:
Is nodeIndex a valid DOM element property in IE?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:53:01+00:00Added an answer on May 23, 2026 at 7:53 pm

    Can anyone tell me why the nodeIndex properties are added in IE8 (and IE7), and is it jQuery that adds them —

    These properties are added by Sizzle (the jQuery selector engine, compare the definition of the Sizzle.selectors object in the jQuery source) , presumably to browsers that do not natively support the :nth-child CSS pseudo class.

    and more importantly: Can I get rid of them in a better way than using a regular expression replacement?

    The clean way would be to load the HTML snippet into a DOM and remove the attributes from it. You can do it on the server side or on the client side using jQuery itself.

    var htmlText = '<DIV nodeIndex="4">Some text.<BR nodeIndex="1"></DIV>';
    var $html = $("<div>" + htmlText + "</div>");
    $html.find("*[nodeIndex]").removeAttr("nodeIndex");
    console.log( $html.html() );
    // logs "<div>Some text.<br></div>"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a site that runs without refreshes, using Jquery and PHP
I'm developing a site using jQuery, and jQuery UI tabs. For some reason, my
I've rewritten my family web site using JavaScript (JQuery) making Ajax calls to PHP
For our site, Im using a lot of jQuery - right now Im looking
Using jQuery, is there a way to select all tag that reference a specific
I am currently using JQuery UI for several UI elements on my site. Is
I am currently developing a site that users the jQuery superfish plugin to construct
Many aspects of my site are dynamic. I am using jquery. I have a
Using jQuery , how can I dynamically set the size attribute of a select
Using jQuery, how do you bind a click event to a table cell (below,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.