code: function(sel, range) {
          var ranges = sel.getAllRanges(), removed = false;
          sel.removeAllRanges();
          for (var i = 0, len = ranges.length; i < len; ++i) {
              if (removed || range !== ranges[i]) {
                  sel.addRange(ranges[i]);
              } else {
                  // According to the draft WHATWG Range spec, the same range may be added to the selection multiple
                  // times. removeRange should only remove the first instance, so the following ensures only the first
                  // instance is removed
                  removed = true;
              }
          }
          if (!sel.rangeCount) {
              updateEmptySelection(sel);
          }
      }
docs: Removal of a single range