title: How to select all text in contenteditable div?
body: <p>Before this is flagged as a duplicate, I want you to realize that no one has actually provided a good answer for this specific question. In <a href="https://stackoverflow.com/questions/3805852/select-all-text-in-contenteditable-div-when-it-focus-click">select all text in contenteditable div when it focus/click</a>, the accepted answer and Tim Down's answer are both not helpful, as they only work when the element is already focused. In my case, I want all the text in the contenteditable div to be selected after the click of a button, even if the div was not focused beforehand.</p>
  
  <p>How could I do this?</p>