Mine didn’t fit inside the form. onion spilled outside the form.
I had a yellow sign in my code but still ran ok. I wonder why. Any help will be nice. Thanks.
Hello! I have a question about step 8/14 from this lesson. We are prompted to create a label and input pair for new topping options. My question is more of an extension and not necessarily directly related, but I am wondering if there is a way to alphabetize these inputs in a way that doesn’t require that I restructure the code. So, ie., let’s say I’ve created 50 label and input without thinking about alphabetization, could I write a simple ‘wrapper’ that would alphabetize them for me?
If it is a static page, then simply arrange the items in alphabetical order. If it is a dynamic page then feasibly, yes, a script could be written to capture all the items, re-order them, then re-insert in the DOM. It won’t be that simple, though.
Confused. Why isn’t this working? what am I missing? I’ve added the input above the label below the
label…I’m not sure why its not working…it should be the same as the previous code above it…? Someone help?
<section class="topping">
<span>What toppings would you like?</span>
<br>
<!--Add your code below for the first checkbox-->
<input id="lettuce" name="topping" type="checkbox" value="lettuce" >
<label for="lettuce">Lettuce</label>
<br>
<input id="tomato" name="topping" type="checkbox" value="tomato">
<label for="tomato">Tomato</label>
Also did it this way...
` <label for="lettuce">Lettuce</label>
<input id="lettuce" name="topping" type="checkbox" value="lettuce" >
<br>
<label for="tomato">Tomato</label>
<input id="tomato" type="checkbox" name="topping" value="tomato">
but it still says Did you add the new <input> inside the correct <section> element?
The value attribute need not be included in the markup if it is "". Only if we wish to establish a default value would we populate that attribute. The browser will insert the attribute when and if the user inputs something. Then it is paired up with the name attribute as its key in the post data associative array.
Hello,
I have a quick question, please.
If in the code below, the name attribute was “toppings” (same spelling as the class =“toppings”), would there be an issue? (example clash in CSS)
Thanks in advance for your reply.
<section class="toppings">
<span>What toppings would you like?</span>
<br>
<label for="lettuce">Lettuce</label>
<input id="lettuce" name="topping" type="checkbox" value="lettuce">
<label for="tomato">Tomato</label>
<!--Add your code below for the third checkbox-->
</section>