3 ::selection { background-color: red; }
5 <script type=
"text/javascript" charset=
"utf-8">
12 <body onload=
"runTest()">
13 <div style=
"height: 100px; overflow-y: scroll;">
14 <div style=
"margin-top: 50px;"><div id=
"target" style=
"display: inline-block; width: 100px; height: 100px;"></div><br></div>
17 var sel
= getSelection();
18 var target
= document
.getElementById("target");
20 sel
.setBaseAndExtent(target
, 0, target
.parentElement
.nextSibling
, 0);
21 document
.body
.offsetTop
;
22 target
.parentElement
.parentElement
.scrollTop
= 50;