title: js trigger click on a based on children element id
body: <p>I want to trigger the click on <code>a</code> tag which has div with <code>id='a'</code>.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    $("#chat_list_content a:has(div[id='a'])").click();
    //$("#chat_list_content a:has(div[id='a'])").trigger("click");
    $('#chat_list_content a').click(function() {
      alert('you are here');
    })
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="//code.jquery.com/jquery-1.11.1.min.js"&gt;&lt;/script&gt;
  &lt;div id="chat_list_content"&gt;
    &lt;a href="#"&gt;
      &lt;div id="a"&gt;A&lt;/div&gt;
    &lt;/a&gt;
    &lt;a href="#"&gt;
      &lt;div id="b"&gt;B&lt;/div&gt;
    &lt;/a&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Click should happen automatically and output alert box. But, there is no respond from the code.</p>
  
  <p>Thanks in advance.</p>