Created
February 12, 2018 00:39
-
-
Save rebelwarrior/82fb4f6681d7d5d8bfc8f1c94715fbe4 to your computer and use it in GitHub Desktop.
Simple DropDown in Elm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Html exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (on, targetValue) | |
main = | |
beginnerProgram { model = "", view = view, update = update } | |
view model = | |
div [] | |
[ select [ on "change" Html.Events.targetValue ] | |
[ option [value "strawberry" ] [ text "strawberry" ] | |
, option [value "chocolate" ] [ text "chocolate" ] | |
, option [value "vanilla" ] [ text "vanilla" ] | |
] | |
, div [] [ text (toString model) ] | |
] | |
update msg model = | |
model ++ (toString msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment