freeCodeCamp Challenge Guide: Add a Submit Button to a Form

Add a Submit Button to a Form


Problem Explanation

In this challenge you want to insert the submit button as the last element of the form ( just before the </form> closing tag) and to give it the attribute type="submit" (everything lowercase) and a text content of “Submit” (first letter uppercase) as specified in the challenge instruction.

  1. the value submit of the attribute type is valid also inside an input tag and it will render a button with almost the same behaviour, but this is not the tag you want to use in this challenge.
<input type="submit">

If you do not specify a value, the button will have a default value choosen by your user agent (generally this is something like “Submit” or “Submit Query”).

If you wish to specify a value like “Send Request” you can do so like this:

<input type="submit" value="Send Request">
12 Likes

What does the _form action="/submit-cat-photo"_do?
Do I need to include _action="/submit-cat-photo"_as an attribute?

1 Like
  • Create a new button element with the text “Like”.
  • Your new button should have the class btn.
  • Make sure all your button elements have a closing tag.

Got the first and last instruction but the “class btn” is the problem, I try hard but dont get it

It just tells you what is supposed to be submitted
yes
< form action="/submit-cat-photo">submit

< /form>
I left spaces by < and> so you could see it

2 Likes