3 <script type="text/javascript">
5 function selectAndJustify()
8 testRunner.dumpAsText();
10 var elem = document.getElementById("test");
11 var selection = window.getSelection();
12 selection.setBaseAndExtent(elem, 2, elem, 6);
13 document.execCommand('JustifyCenter', false, null);
20 <span id="test" contenteditable="true" >
23 <b>Select all text in this line and use justify command.</b>