Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=target>target</div>
<script>
test(() => {
const target = document.getElementById('target');
window.location.href = '#target';
assert_equals(document.querySelector(':target'), target,
':target should match before reinsertion.');
target.remove();
document.body.appendChild(target);
assert_equals(document.querySelector(':target'), target,
':target should match after reinsertion.');
}, ':target should match the target element even after it is removed and reinserted.');
</script>