Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 2 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/syntax/serializing-html-fragments/serializing-lt-gt.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Escape "<" and ">" in attribute values when serializing</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<span id="test"><a b="<>"></a></span>
<script>
const test_el = document.getElementById("test");
test(() => {
assert_equals(test_el.innerHTML, "<a b=\"<>\"></a>");
}, "innerHTML");
test(() => {
assert_equals(test_el.outerHTML, "<span id=\"test\"><a b=\"<>\"></a></span>");
}, "outerHTML");
</script>