title: jQuery: Append HTML if tag contains specific class
body: <p>I think this should be fairly simple to do, but Google isn't producing any results so hopefully someone here might be able to help.</p>
  
  <p>Using jQuery I want to append some HTML inside an element if it contains a ul with a specific class.</p>
  
  <p>So if a "main-menu li" element contains "ul.sub-menu" I want to append the "expand" div inside the "main-menu li" element which contains it.</p>
  
  <p>Here's the HTML I'm working with: <a href="http://pastebin.com/4pwN9Rte" rel="nofollow">http://pastebin.com/4pwN9Rte</a></p>
  
  <p>Any help much appreciated!</p>