hypothetical-box-scroll-parent-ref.html (525B)
1 <!doctype html> 2 <meta charset=utf-8> 3 <!-- Our target div should be placed as if it were a child of the overflowing -- 4 -- thing; this is simplest to accomplish by just having the overflowing thing -- 5 -- absolutely positioned so the target div is placed as if it were not there --> 6 <div style="overflow: auto; height: 100px; width: 200px; position: absolute"> 7 <div style="width: 400px; height: 10px"></div> 8 </div> 9 <div id="target">Modified text</div> 10 <script> 11 document.querySelector("div").scrollLeft = 1000; 12 </script>