{"componentChunkName":"component---src-templates-blog-post-js","path":"/blog/freecodecamp/frontend/html/fcc-challenge-33-create-a-set-of-checkboxes/","result":{"data":{"site":{"siteMetadata":{"title":"Be Brav3"}},"markdownRemark":{"id":"e25f4537-e438-5949-96c2-39f6d0ea306f","excerpt":"In Free Code Camp challenge 33 we learn to create checkboxes. Forms commonly use checkboxes for questions that may have more than one answer. Checkboxes are a…","html":"<p>In <a href=\"https://www.freecodecamp.com/challenges/create-a-set-of-checkboxes\">Free Code Camp challenge 33</a> we learn to create checkboxes.</p>\n<blockquote>\n<p>Forms commonly use checkboxes for questions that may have more than one answer.</p>\n<p>Checkboxes are a type of input</p>\n<p>Each of your checkboxes should be nested within its own label element.</p>\n<p>All related checkbox inputs should have the same name attribute.</p>\n<p>Here’s an example of a checkbox:</p>\n</blockquote>\n<blockquote>\n<p>[html]</p>\n</blockquote>\n<blockquote>\n<p><label><input type=\"checkbox\" name=\"personality\"> Loving</label></p>\n</blockquote>\n<blockquote>\n<p>[/html]</p>\n</blockquote>\n<blockquote>\n<p>Add to your form a set of three checkboxes. Each checkbox should be nested within its own label element. All three should share the name attribute of personality.</p>\n</blockquote>\n<p>The original code is below:</p>\n<p>[html]</p>\n<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">\n  \n<style>\n    \n.red-text {\n      \ncolor: red;\n    \n}\n<p>h2 {</p>\n<p>font-family: Lobster, Monospace;</p>\n<p>}</p>\n<p>p {</p>\n<p>font-size: 16px;</p>\n<p>font-family: Monospace;</p>\n<p>}</p>\n<p>.thick-green-border {</p>\n<p>border-color: green;</p>\n<p>border-width: 10px;</p>\n<p>border-style: solid;</p>\n<p>border-radius: 50%;</p>\n<p>}</p>\n<p>.smaller-image {</p>\n<p>width: 100px;</p>\n<p>}</p>\n</style>\n<h2 class=\"red-text\">CatPhotoApp</h2>\n<p>Click here for <a href=\"#\">cat photos</a>.</p>\n<p><a href=\"#\"><img class=\"smaller-image thick-green-border\" alt=\"A cute orange cat lying on its back. \" src=\"https://bit.ly/fcc-relaxing-cat\"></a></p>\n<p>Things cats love:</p>\n  \n<ul>\n    \n<li>cat nip</li>\n    \n<li>laser pointers</li>\n    \n<li>lasagna</li>\n  \n</ul>\n  \n<p>Top 3 things cats hate:</p>\n  \n<ol>\n    \n<li>flea treatment</li>\n    \n<li>thunder</li>\n    \n<li>other cats</li>\n  \n</ol>\n  \n<form action=\"/submit-cat-photo\">\n    \n<label><input type=\"radio\" name=\"indoor-outdoor\"> Indoor</label>\n    \n<label><input type=\"radio\" name=\"indoor-outdoor\"> Outdoor</label>\n    \n<input type=\"text\" placeholder=\"cat photo URL\" required>\n    \n<button type=\"submit\">Submit</button>\n  \n</form>\n  \n[/html]\n<p>The updated code with checkboxes is below:</p>\n<p>[html highlight=”49-51″]</p>\n<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">\n  \n<style>\n    \n.red-text {\n      \ncolor: red;\n    \n}\n<p>h2 {</p>\n<p>font-family: Lobster, Monospace;</p>\n<p>}</p>\n<p>p {</p>\n<p>font-size: 16px;</p>\n<p>font-family: Monospace;</p>\n<p>}</p>\n<p>.thick-green-border {</p>\n<p>border-color: green;</p>\n<p>border-width: 10px;</p>\n<p>border-style: solid;</p>\n<p>border-radius: 50%;</p>\n<p>}</p>\n<p>.smaller-image {</p>\n<p>width: 100px;</p>\n<p>}</p>\n</style>\n<h2 class=\"red-text\">CatPhotoApp</h2>\n<p>Click here for <a href=\"#\">cat photos</a>.</p>\n<p><a href=\"#\"><img class=\"smaller-image thick-green-border\" alt=\"A cute orange cat lying on its back. \" src=\"https://bit.ly/fcc-relaxing-cat\"></a></p>\n<p>Things cats love:</p>\n  \n<ul>\n    \n<li>cat nip</li>\n    \n<li>laser pointers</li>\n    \n<li>lasagna</li>\n  \n</ul>\n  \n<p>Top 3 things cats hate:</p>\n  \n<ol>\n    \n<li>flea treatment</li>\n    \n<li>thunder</li>\n    \n<li>other cats</li>\n  \n</ol>\n  \n<form action=\"/submit-cat-photo\">\n    \n<label><input type=\"radio\" name=\"indoor-outdoor\"> Indoor</label>\n    \n<label><input type=\"radio\" name=\"indoor-outdoor\"> Outdoor</label>\n    \n<label><input type=\"checkbox\" name=\"personality\"> Checkbox 1</label>\n    \n<label><input type=\"checkbox\" name=\"personality\"> Checkbox 2</label>\n    \n<label><input type=\"checkbox\" name=\"personality\"> Checkbox 3</label>\n    \n<input type=\"text\" placeholder=\"cat photo URL\" required>\n    \n<button type=\"submit\">Submit</button>\n  \n</form>\n  \n[/html]","frontmatter":{"title":"FCC Challenge 33: Create a Set of Checkboxes","date":"March 14, 2016","description":null}}},"pageContext":{"slug":"/blog/freecodecamp/frontend/html/fcc-challenge-33-create-a-set-of-checkboxes/","previous":{"fields":{"slug":"/blog/freecodecamp/frontend/html/fcc-challenge-32-create-a-set-of-radio-buttons/"},"frontmatter":{"title":"FCC Challenge 32: Create a Set of Radio Buttons"}},"next":{"fields":{"slug":"/blog/freecodecamp/frontend/html/fcc-challenge-34-check-radio-buttons-and-checkboxes-by-default/"},"frontmatter":{"title":"FCC Challenge 34: Check Radio Buttons and Checkboxes by Default"}}}}}