mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-28 19:38:13 +00:00
23 lines
468 B
HTML
23 lines
468 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script type="text/javascript">
|
|
function doTest()
|
|
{
|
|
document.getSelection().selectAllChildren(document.body);
|
|
var editor = document.getElementById("editor");
|
|
editor.focus();
|
|
editor.selectionStart = 2;
|
|
editor.selectionEnd = 4;
|
|
editor.blur();
|
|
editor.focus();
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="doTest()">
|
|
<p>normal text</p>
|
|
<textarea id="editor">textarea</textarea>
|
|
</body>
|
|
</html>
|
|
|