Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/dom/elements/global-attributes/the-anchor-attribute-004.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel=author href="mailto:masonf@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=anchor1>Anchor 1</div>
<div id=anchor2>Anchor 2</div>
<svg id=foo anchor=anchor1></svg>
<script>
test(() => {
assert_equals(foo.anchorElement,anchor1,'Non-HTML elements can use the anchor attribute');
foo.anchorElement = anchor2;
assert_equals(foo.anchorElement,anchor2,'The anchorElement IDL also works for non-HTML elements');
});
</script>