Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: layout/reftests/selection/reftest.list
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" charset="utf-8">
function selectAllOfNewNodes() {
window.getSelection().removeAllRanges();
var newNode = document.createElement('span');
newNode.innerHTML = "Kitty";
document.getElementById('new_nodes').appendChild(newNode);
var range = document.createRange();
range.selectNode(document.getElementById('new_nodes'));
window.getSelection().addRange(range);
}
</script>
</head>
<body onload="selectAllOfNewNodes()">
* <span id="new_nodes"><span>Hello</span> </span> *
</body>
</html>