зеркало из https://github.com/mozilla/gecko-dev.git
19 строки
494 B
HTML
19 строки
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>
|