ID's should be unique on the page, when you have multiple elements with same ID's, jQuery selects only the first one. That's because it doesn't have to bother looking for others as there isn't supposed to be any more – that might explain the weird behaviour you're experiencing.
If you want multiple elements to have the same functionality, give them the same class. If you want to identify a specific element, give it an id. This isn't limited to just jQuery, but to HTML and CSS overall.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…