summaryrefslogtreecommitdiffstats
path: root/layout/reftests/selection/addrange-1.html
blob: 648d4214041e9b6e046174c2007858731badbec3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html>
    <head>
        <title>Testcase #2 for bug 602331</title>
        <script type="text/javascript" charset="utf-8">
            function selectNewlyAdded() {
                window.getSelection().removeAllRanges();
                
                var newNode = document.createElement('span');
                newNode.innerHTML = "Hello Kitty";
                document.getElementById('new_nodes').appendChild(newNode);
                var range = document.createRange();
                range.selectNode(newNode);
                window.getSelection().addRange(range);
            }
            
        </script>
    </head>
    <body onload="selectNewlyAdded()">
        * <span id="new_nodes"></span> *
    </body>
</html>