Conventions etc

Complete noob question here, im currently going through some basic HTML learning. I’m curios about something though. And here is an example

I’m inserting a submit button to the form. I’ve successfully done that but i’ve noticed that where the button type=submit is, i can use either just submit or “submit” and the test passes. Should it work in both cases? and is there some kind of convention that says either work but you should use/not use quotation marks.

Hope that makes sense :slight_smile:


Your code so far

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

<a href="#"><img src="" alt="A cute orange cat lying on its back."></a>

<p>Things cats love:</p>
  <li>cat nip</li>
  <li>laser pointers</li>
<p>Top 3 things cats hate:</p>
  <li>flea treatment</li>
  <li>other cats</li>
<form action="">
  <input type="text" placeholder="cat photo URL"><button type=submit>submit</button>

Your browser information:

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

Challenge: Add a Submit Button to a Form

Link to the challenge:

Technically both works. HTML allows you to write attribute values without quotation marks.

But, it is not a good practice to do so. The good practice is to always use double quotes on all attribute values.

1 Like

just remember that if there are spaces or special characters in the attribute value then you need to put the quotes

1 Like

Thanks both of you, really useful info :smiley: