Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
"use strict";
document.addEventListener("DOMContentLoaded", () => {
const select = document.querySelector("select");
select.appendChild(document.querySelector("option"));
select.appendChild(document.createElement("optgroup"));
document.querySelector("p").appendChild(document.querySelector("li[contenteditable]"));
getSelection().collapse(document.querySelector("output"), 0);
document.execCommand("insertHTML", false, select.innerHTML);
});
</script>
</head>
<body>
<dl>
<select>a</select>
<p></p>
<option>
<li contenteditable>
<output>
</output><li></option></dl></body>
</html>