You cannot have multiple ID’s in your HTML markup.
It would be an invalid markup. When querying for $(‘#foobar’) and there are five elements which have that id, you would only get the first instance. So even if there would be a way (…) to apply code to all of those nodes, don’t do it.
Use Classnames when you want to “combine” some elements.
Stack overflow, there has many good reply.
Cheers!