# Model -\> html Model

**URL:** <https://discourse.elm-lang.org/t/model-html-model/7643>\
**Category:** Learn\
**Created:** [August 9, 2021, 1:44pm UTC](https://discourse.elm-lang.org/t/model-html-model/7643 "2021-08-09T13:44:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zack\_slm](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/zack_slm/32/4166_2.png) [@Zack\_slm](https://discourse.elm-lang.org/u/Zack_slm)\
**Post date:** [August 9, 2021, 1:44pm UTC](https://discourse.elm-lang.org/t/model-html-model/7643/1 "2021-08-09T13:44:15Z")

</div>

Hello,  
i try to learn ELM and I code program which do this operation :  
12 : 1+2+12 = 15  
15 : 1+5+15 = 21  
i try to add a function to do iteration, for exemple for :  
output = 12, iteration = 2  
12: 1+2+12 = 15 / 15 : 1+5 + 15 = 21  
output =21

I have problem with my view Model → html Model  
this is code in ELLIE : [https://ellie-app.com/dXDgf9YgXS3a1](https://ellie-app.com/dXDgf9YgXS3a1)

thank you

---

<div class="post-metadata">

**Author:** ![grigorious](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/grigorious/32/3549_2.png) [@grigorious](https://discourse.elm-lang.org/u/grigorious)\
**Post date:** [August 9, 2021, 2:33pm UTC](https://discourse.elm-lang.org/t/model-html-model/7643/2 "2021-08-09T14:33:25Z")

</div>

Hi,  
lets go step by step:

the type of your view function is:

```elm
view : Model -> Html Msg

```

This means that it takes a `Model` type as the input and outputs a `Html Msg` type

```elm
I cannot find a `input` variable

```

the compiler is telling you it can’t find input - that is because you did not import it! You have 2 possibilities:

```elm
-- inport the html input element
import Html exposing (Html, button, div, text, input)

```

or

```elm
-- use it strait from the module
Html.input [] []

```

Notice above that `Html.input` is a function that takes 2 arguments, its signature is:

```elm
input : List (Attribute msg) -> List (Html msg) -> Html msg

```

it takes a list of attributes `Attribute msg` and a list of Html nodes `Html msg`, notice that the `msg` starts with a small letter - this means that it could be anything - any message!

You are also using `placeholder`, `id` attributes without importing them, I would suggest you use `Attr.placeholder` since you did this at the top:

```elm
import Html.Attributes as Attr

```

From the code I suggest you go thru the [elm guide](https://guide.elm-lang.org) and also open the main packages like:  
[core](https://package.elm-lang.org/packages/elm/core/latest/)  
[html](https://package.elm-lang.org/packages/elm/html/latest/)  
[json](https://package.elm-lang.org/packages/elm/json/latest/)  
…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [August 19, 2021, 2:33pm UTC](https://discourse.elm-lang.org/t/model-html-model/7643/3 "2021-08-19T14:33:43Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
