<textarea xmlns="http://www.w3.org/1999/xhtml">
  <script>document.documentElement.selectionStart</script>
</textarea>