title: Focus an input field when clicking on an element, except if some text within the container was highlighted
body: <p>An input field <code>#chatInput</code> needs to be be focused when clicking on a container element <code>#text</code> EXCEPT if text inside that element was (highlighted via either double click or mouse selection)</p>
  
  <pre><code>// what I got so far which is incomplete
  $('#text').on('click', function (e) {
    $('#chatInput').focus();
  });
  </code></pre>
  
  <p>Fiddle: <a href="https://jsfiddle.net/xhykmtwy/4/" rel="nofollow">https://jsfiddle.net/xhykmtwy/4/</a></p>