the-anchor-attribute-004.tentative.html (599B)
1 <!DOCTYPE html> 2 <link rel=author href="mailto:masonf@chromium.org"> 3 <link rel="help" href="https://github.com/whatwg/html/pull/9144"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 7 <div id=anchor1>Anchor 1</div> 8 <div id=anchor2>Anchor 2</div> 9 <svg id=foo anchor=anchor1></svg> 10 11 <script> 12 test(() => { 13 assert_equals(foo.anchorElement,anchor1,'Non-HTML elements can use the anchor attribute'); 14 foo.anchorElement = anchor2; 15 assert_equals(foo.anchorElement,anchor2,'The anchorElement IDL also works for non-HTML elements'); 16 }); 17 </script>