Does the order matter or do I have a typo?

I am confused about the order when using the element.

Coming from passwords we were given the example:

       <input type="passwords">

So I used that for numbers, writing:

   <form action="/practice.html" method="POST">
        <label for="numbers"></label>
            <input type="number" id="amount" name="amount" step="1">
    </form>

This was marked as wrong as it was meant to be:

   <form action="/practice.html" method="POST">
       <label for="numbers"></label>
          <input id="amount" type="number" name="amount" step="1">
    </form>

Can anyone explain how I am meant to know the ordering and why it differs? I am enjoying codecademy but it doesn’t explain why something I have done is wrong! So then I am just trying and trying to until I get it right, but don’t really feel I understand why it was ever wrong?

Thanks in advance!

1 Like

Actually ordering doesnt matter your id doesnt match the label thats why it showed wrong

3 Likes

This was the wrong one:

<form action="/practice.html" method="POST"> <label for="numbers"></label> <input type="number" id="amount" name="amount" step="1"> </form>

Here

<input id="amount">

is incorrect. It should be same as <label for="numbers">

Solution: use id in <input id="numbers">. The sequence does not matter.

2 Likes

bro you have to associate the to with the help of #id your answer was wrong because you didn’t type the correct id as you mentioned in label was number but what you mentioned in was amount…
hope this will help you