title: Difference between $("#id") and $("[id=]")
body: <p>In my page, due to some reason (which I do not find relevant to the topic hence not explaining) a div gets duplicated and two divs with same id are generated in my html. While writing jquery code to remove all divs except topmost, I found that <code>$("#id")</code> was returning me just 1 element(note: there are two divs with same id now) whereas <code>$("[id=]")</code> was returning me <code>2</code>. So finally my code worked with <code>$("[id=]")</code> but not with <code>$("#id")</code>.
  Any reason why? Is it that <code>$("#id")</code> returns only the first element it finds with specified id?</p>
  
  <p>Please note that I have already come across a <a href="https://stackoverflow.com/questions/23733990/jquery-what-is-the-difference-between-id-and-id/39566320#39566320">thread</a> which has a similar question but does not answer my query</p>