title: JavaScript get word before cursor
body: <p>Okay, I've been looking all over the web to find a solution but I couldn't find one, is there a way to get the word before the caret position in an editable div so a bit like:</p>
  
  <pre><code>This is some| demo texts
  </code></pre>
  
  <p>This should return the word "some"... I don't know if this is possible, I would be glad for any help, thanks :).</p>