Nesting test field inside a form element

Nesting test field inside a form element
0

Tell us what’s happening:
I have difficulty nesting text field inside a form element, and add the action="/submit-cat-photo" attribute to the form element.

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>
 <form> 
  <input type="text" placeholder="cat photo URL" <form action="/submit-cat-photo"></form></input>
  </form>
  
</main>

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-html-and-html5/create-a-form-element/

You are close, but you have also tried to nest a form element inside the input tag. Remove the extra form element and remember that input elements are self-closing and do not have closing tags.

Thank you very much, your response was helpful.
<form type="text" placeholder="cat photo URL" action="/submit-cat-photo"></form>
this is what I have done so far but still having a wrong result, what else should i correct in the code.

What you are not understanding is what it means to “nest” one element into another element. See the example below for how you would nest a p element into a div element.

<div><p>This element is nested in a div element</p></div>

still having some difficulty achieving that

Post your latest code attempt.

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

<form type="text" placeholder="cat photo URL" action="/submit-cat-photo"></form>

This is my last code attempt.

Now you have inserts the attributes of the input element into the form element’s opening tag. Look back at my example again. One complete element will be between another element’s tags. form elements have an opening an closing tag. input elements are self-closing and do not have closing tags.