範囲選択内のリンクを開く

プログラムのリハビリ中。
一瞬、for文の書き方忘れて焦った。。

document.addEventListener('DOMContentLoaded', function() {
  document.body.addEventListener('mouseup', function() {
    var selection = window.getSelection();

    if (selection.rangeCount < 1) {
      return;
    }

    var anchorList = selection.getRangeAt(0).cloneContents().querySelectorAll('a');

    for (var i = 0, l = anchorList.length; i < l; i++) {
      window.open(anchorList[i].href);
    }
  }, false);
}, false);