зеркало из https://github.com/mozilla/gecko-dev.git
18 строки
518 B
HTML
18 строки
518 B
HTML
<html class="reftest-wait">
|
|
<body onload="start()">
|
|
<div onfocus="done()" contenteditable>foo<div contenteditable="false"><a href="#">bar</a></div>baz</div>
|
|
<script>
|
|
var div = document.querySelector("div");
|
|
function start() {
|
|
div.focus();
|
|
}
|
|
function done() {
|
|
var sel = getSelection();
|
|
// Set the caret right before "baz"
|
|
sel.collapse(div.lastChild, 0);
|
|
document.documentElement.removeAttribute("class");
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|