title: Selecting text in an element (akin to highlighting with your mouse)
body: <p>I would like to have users click a link, then it selects the HTML text in another element (<em>not</em> an input).</p>
  
  <p>By "select" I mean the same way you would select text by dragging your mouse over it. This has been a bear to research because everyone talks about "select" or "highlight" in other terms.</p>
  
  <p>Is this possible? My code so far:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;a href="javascript:" onclick="SelectText('xhtml-code')"&gt;Select Code&lt;/a&gt;
  &lt;code id="xhtml-code"&gt;Some Code here &lt;/code&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>function SelectText(element) {
      $("#" + element).select();
  }
  </code></pre>
  
  <p>Am I missing something blatantly obvious?</p>