title: How to detect if a div is selected?
body: <p>I have a number of <code>divs</code> each has the property <code>contenteditable="true"</code>, I am able to detect when the user clicks or hovers over an element using JQuery, but how can I tell if the <code>div</code> is selected i.e. the text cursor appears within div and is ready to accept text input.</p>
  
  <p>Ideally I am after a JQuery solution.</p>
  
  <p>This isn't a duplicate of <a href="https://stackoverflow.com/questions/15657686/jquery-event-detect-changes-to-the-html-text-of-a-div">this</a> as question marked does not take into consideration that a div is selected but not being edited!</p>