mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-09-10 11:54:40 +00:00
18 lines
518 B
HTML
18 lines
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>
|