id-name.html (595B)
1 <!DOCTYPE html> 2 <title>id and name attributes and getElementById</title> 3 <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> 4 <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-id-attribute"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <div id="log"></div> 8 <div id="test"> 9 <div name="abcd"></div> 10 <p name="abcd" id="abcd"></p> 11 </div> 12 <script> 13 test(function() { 14 assert_equals(document.getElementById("abcd").nodeName, "P"); 15 assert_equals(document.getElementById("abcd").localName, "p"); 16 }); 17 </script>