How to nest input element in form

**Tell us what’s happening:**i am unable to nest input element in form

Your code so far


<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more <a href="#">cat photos</a>.</p>

<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>

<p>Things cats love:</p>
<ul>
  <li>cat nip</li>
  <li>laser pointers</li>
  <li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
  <li>flea treatment</li>
  <li>thunder</li>
  <li>other cats</li>
</ol>
<input type= "text" placeholder = "Cat photo URL">

<form action="https://freecatphotoapp.com/submit-cat-photo"><"Cat photo URL"></form>

</main>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36.

Challenge: Create a Form Element

Link to the challenge:

2 Likes

Hi @Eeshan. You have done everything almost correctly, but there are some more things to do:

Why is there a separate “Cat Photo URL” inside the form element? I think you tried to nest it inside the form element, but instead of the “Cat Photo URL”, you need to put the EXISTING input element inside the form element.

If you don’t understand nesting, I will explain:

<div>
   <p> // this is now nested inside div.
</div>

In the example above, the p element is nested inside the div and becomes the children of div… Notice that the p element is placed between the opening <div> tag and the closing </div> tag. When you put an element inside another element’s opening and closing tags, that element is nested.

This is the same thing you need to do here.

Hope you understand.

@Eeshan
nesting means nesting any tag into its parent tag
For Example

<div>
     <p>
        bhabhabhabhabhbhahbahbhabbh
     </p>
</div>

Now p is nested in its parent tag div

In your case

The input tag should be nested within the form tag.
It should be like

<form>
     <input type= "text" placeholder = "Cat photo URL">
</form>

Hope this Helped
Thanks,
Codely

1 Like