Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple DOM elements with matching ID's - is this legal? #320

Open
Fandangi opened this issue Jan 10, 2018 · 2 comments
Open

Multiple DOM elements with matching ID's - is this legal? #320

Fandangi opened this issue Jan 10, 2018 · 2 comments

Comments

@Fandangi
Copy link

Hi - thanks for the great plugin. I noticed that for itemviews, stickit produces multiple dom elements with identical id properties.

For example

{ firstName: "Tom"},{firstName: "Dick"},{firstName: "Harry")

passed into a stickit enabled view of

  • will produce

  • Tom
  • Dick
  • Harry
  • My question is - is it allowed to have these multiple DOM elements with the same ID?

    Thanks.

    [PS. I realise this is an old and stable plugin now and this may not be answered for a while...a bit like the Heiniken complaints line ad...]

    @vendethiel
    Copy link
    Contributor

    It's at least considered a very bad practice to have different ids. I'm not sure the behavior is defined.

    @Fandangi
    Copy link
    Author

    Thanks for responding so soon. That being the case, are you aware of any option in stickit to clear the id's after rendering, or carry out some other strategy? I am quite happily using stickit with Marionette 3.5 views and it works like a charm so I am loathe to have to replace it when it works so smoothly.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants