function selectContentEditable (contentEditableElement) {
  if (!contentEditableElement || contentEditableElement.nodeName !== 'DIV') {
    return
  }

  let sel, range
  if (window.getSelection && document.createRange) {
    range = document.createRange()
    range.selectNodeContents(contentEditableElement)
    sel = window.getSelection()
    sel.removeAllRanges()
    sel.addRange(range)
  }
}
Select all text of a content editable div.
http://stackoverflow.com/a/3806004/1262753
@param {Element} contentEditableElement   A content editable div