title: jQuery: Check for existence of BR as first or last element, including text nodes within a paragraph
body: <p>I wish to test in jQuery for the existence of a <code>&lt;br /></code> as the very first, or very last element (including text nodes) within a paragraph. The 2 examples below would be true:</p>
  
  <pre>
  <code>
  &lt;p>
      &lt;br />
      Lorem ipsum dolor sit amet consectetur, adiscipling elit.
  &lt;/p>
  </code>
  </pre>
  
  <pre>
  <code>
  &lt;p>
      Lorem ipsum dolor sit amet consectetur, adiscipling elit.
      &lt;br />
  &lt;/p>
  </code>
  </pre>
  
  <p>While this example would be false:</p>
  
  <pre>
  <code>
  &lt;!-- This is false -->
  &lt;p>
      Lorem ipsum dolor sit amet consectetur, adiscipling elit
      &lt;br />
      Lorem ipsum dolor sit amet consectetur, adiscipling elit.
  &lt;/p>
  </code>
  </pre>
  
  <p>If true, the following <code>class</code>&rsquo;s of <code>diog-fail brbr</code> are to be applied to the containing paragraph element.</p>