title: DOM4: Deprecated properties and methods, what does it mean?
body: <blockquote>
    <p>"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."</p>
  </blockquote>
  
  <p>Scrolling down the page, we can see replacements for nodeName and NodeValue, using Attr.name and Attr.value.</p>
  
  <p><a href="https://developer.mozilla.org/en/DOM/Attr#Deprecated_properties_and_methods">https://developer.mozilla.org/en/DOM/Attr#Deprecated_properties_and_methods</a></p>
  
  <p>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!</p>
  
  <p>It is deprecated for an Attribute but is it for a Node too?</p>
  
  <p>Attr object: <a href="http://www.w3schools.com/jsref/dom_obj_attr.asp">http://www.w3schools.com/jsref/dom_obj_attr.asp</a></p>
  
  <p>Edit: nodeValue will ONLY be deprecated for Attributes (Attr) since Attr will not inherit from a Node anymore in DOM Level 4:</p>
  
  <p>Here's a quick example that helped me to understand:</p>
  
  <pre><code>&lt;div id="myAttribute"&gt;myTextNode&lt;/div&gt;
  
  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")
  </code></pre>
  
  <p>Maybe this will avoid confusion to others when accessing Attributes/Nodes :)</p>