Yes, browsers will allow multiple ids without error. I know for sure that document.getElementById() will simply return the first element with the id that it finds in the DOM. I'm not as sure about how duplicate ids in the DOM are treated by CSS, but I wouldn't be surprised if you were right and they'll all get the same styles.
- Josh On Tue, May 23, 2017 at 7:45 AM, Alex Harui <aha...@adobe.com.invalid> wrote: > > > On 5/23/17, 7:32 AM, "Josh Tynjala" <joshtynj...@gmail.com> wrote: > > >I didn't consider that ids were supported in classic Flex SDK CSS. In that > >case, I guess it really was global then. > > I guess you can think of that as global, but really, there isn't any > restriction in regular Flex or FlexJS on having one and only one id. You > could have many instances with the same ID and the CSS ID selector would > work for each one. I haven't tried this in the browser for JS output, but > I would guess it would work there as well. I think the browsers are > forgiving despite what the spec says. AIUI, the browser didn't complain > when Piotr had duplicate ids. It was third-party library code that had an > expectation. > > Of course, I could be wrong... > -Alex > >