https://github.com/mozilla/gecko-dev
Raw File
Tip revision: 99f6c7aff4efb16cba51b9c84fe4348dec8a2be5 authored by seabld on 05 September 2014, 04:56:57 UTC
Added tag SEAMONKEY_2_29_RELEASE for changeset FIREFOX_32_0_BUILD1. CLOSED TREE a=release
Tip revision: 99f6c7a
bug482484-ref.html
<!DOCTYPE HTML><html><head></head>
<body>
<div contentEditable="true" id="div" spellcheck="false"><p id="p">ABC</p></div>
<script>
  // Position the caret after the "A"
  var div = document.getElementById('div');
  var p = document.getElementById('p');
  div.focus();
  var sel = window.getSelection();
  sel.removeAllRanges();
  var range = document.createRange();
  range.setStart(p.firstChild, 1)
  range.setEnd(p.firstChild, 1);
  sel.addRange(range);
</script>

</body>
</html>
back to top