code: function()
      {
          if( window.getSelection )
          {
              var sel = window.getSelection();
              if( ! sel.isCollapsed )
              {
                  // Form-submits via Enter throw 'NS_ERROR_FAILURE' on Firefox 34
                  try {
                      sel.collapseToEnd();
                  }
                  catch( e ) {
                  }
              }
          }
          else if( document.selection )
          {
              var sel = document.selection;
              if( sel.type != 'Control' )
              {
                  var range = sel.createRange();
                  range.collapse(false);
                  range.select();
              }
          }
      }
docs: http://stackoverflow.com/questions/8513368/collapse-selection-to-start-of-selection-not-div