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 7903435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:45:10+00:00 2026-06-03T09:45:10+00:00

Warning: In DOM Core 1, 2 and 3, Attr inherited from Node. This is

  • 0

“Warning: In DOM Core 1, 2 and 3, Attr inherited from Node. This is no longer the case in DOM4. In order to bring the implementation of Attr up to specification, work is underway to change it to no longer inherit from Node . You should not be using any Node properties or methods on Attr objects. Starting in Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4) , the ones that are going to be removed output warning messages to the console. You should revise your code accordingly. See Deprecated properties and methods for a complete list.”

Scrolling down the page, we can see replacements for nodeName and NodeValue, using Attr.name and Attr.value.

https://developer.mozilla.org/en/DOM/Attr#Deprecated_properties_and_methods

What does it really mean for other methods like attributes or childNodes?
The reference says it is deprecated but they don’t give any replacement!

It is deprecated for an Attribute but is it for a Node too?

Attr object: http://www.w3schools.com/jsref/dom_obj_attr.asp

Edit: nodeValue will ONLY be deprecated for Attributes (Attr) since Attr will not inherit from a Node anymore in DOM Level 4:

Here’s a quick example that helped me to understand:

<div id="myAttribute">myTextNode</div>

var myDiv = document.getElementById("myAttribute");

// If you want to get "myAttribute" from div tag

alert(myDiv.attributes[0].value);
// Correct way to get value of an attribute (displays "myAttribute")
alert(myDiv.attributes[0].nodeValue);
// Working too but deprecated method for Attr since it doesn't inherit from Node in DOM4 (.nodeValue is specific to a Node, not an Attribute)

// If you want to get "myTextNode" from div tag

alert(myDiv.childNodes[0].value);
// Not working since .value is specific to an attribute, not a Node (displays "undefined")
alert(myDiv.childNodes[0].nodeValue);
// Working, .nodeValue is the correct way to get the value of a Node, it will not be deprecated for Nodes! (displays "myTextNode")

Maybe this will avoid confusion to others when accessing Attributes/Nodes 🙂

  • 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-06-03T09:45:12+00:00Added an answer on June 3, 2026 at 9:45 am

    What they are saying is that objects that were Attr instances (e.g. such as those returned by Element.getAttributeNode()), used to have properties that it inherited from Node.

    However, because this is not the case in DOM4, they are trying to remove this inheritance. Because of this, when you now get an instance of a Attr object, the properties listed in the deprecated list will behave as they’re documented.

    The big question: It is deprecated for an Attribute but is it for a Node too?: No, they are not deprecated. You can see the list of properties Node has from it’s own documentation page.

    Attr objects aren’t used much (ever?) anyway; are you sure this concerns you?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Warning: This is inherited legacy code that was initially put together in the early
WARNING: content not work-appropriate This does not retrieve image successfully from a web page
warning: passing argument 1 of 'bsearch' makes pointer from integer without a cast and
Warning: This question has been heavily edited. I tried my best to guess the
I am making use of simplehtmldom which has this funciton: // get html dom
Warning - I am very new to NHibernate. I know this question seems simple
I am getting an odd error when running $dom = new DOMDocument(1.0, utf-8);: Warning
Been scratching my head at this one for way too long now... $dom =
Warning:Total Rails Newb (TRN). This should be a pretty basic question so I'm hoping
Warning: This is a not very serious question/discussion that I am posting... but I

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.