Skip to content

for should be an attribute rather than a property #148

Open
rtfeldman/elm-css
#598

Description

@decioferreira

Link to SSCCE: https://ellie-app.com/kGcc5FVT7a1/4

As described on the example, when a label element without a for property is replaced by one that has the for property on the DOM tree, when re-adding the first element it will be rendered with a for property with value of "empty string".

After talking with @zwilias, this seems to be related with #142 and a workaround seems to be:

for_ : String -> Html.Attribute msg
for_ =
    Html.Attributes.attribute "htmlFor"

A working example with this workaround can be found on https://ellie-app.com/mckMkM7SZa1/1

Also, the relevant spec: https://html.spec.whatwg.org/multipage/forms.html#the-label-element

Activity

  1. process-bot commented on Sep 26, 2017

    @process-bot

    Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

    Here is what to expect next, and if anyone wants to comment, keep these things in mind.

  2. added a commit that references this issue on Nov 20, 2025
    03132c0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions