The identifier must be unique on the page, when you have several elements with the same identifiers, jQuery selects only the first. This is because he does not need to worry about finding others, since there should not be more. which may explain the strange behavior you experience.
, , . , . jQuery, HTML CSS .