mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-17 18:03:06 +09:00
18 lines
494 B
HTML
18 lines
494 B
HTML
<script>
|
|
onload = function() {
|
|
var testContainer = document.createElement("span");
|
|
testContainer.contentEditable = true;
|
|
document.body.appendChild(testContainer);
|
|
|
|
function queryFormatBlock(content)
|
|
{
|
|
testContainer.innerHTML = content;
|
|
while (testContainer.firstChild)
|
|
testContainer = testContainer.firstChild;
|
|
window.getSelection().collapse(testContainer, 0);
|
|
document.queryCommandValue('formatBlock');
|
|
}
|
|
|
|
queryFormatBlock('<ol>hello</ol>');
|
|
};
|
|
</script>
|