JavaScript Treehouse Club - MASH MASH - HTML Forms, Divs, and Inputs

John Cleghorn
John Cleghorn
2,355 Points

what is a 'class' attribute?

what is a 'class' attribute?

index.html
<body>
  <h1>First Day of School</h1>

  <form>

    <div>
      <div class="favorite_stuff">
      <h4>Favorite Foods?</h4>
      <input name="food[]">
      <input name="food[]">
      <input name="food[]">
      <input name="food[]">
    </div>

    <div>
      <div class="favorite_stuff">
      <h4>Favorite Animals?</h4>
      <input name="animal[]">
      <input name="animal[]">
      <input name="animal[]">
      <input name="animal[]">
    </div>

  </form>

</body>

1 Answer

A class is a way to reference an element in the HTML and be able to manipulate it. No need to be concerned with classes yet, keep going with the course, it will teach you about classes later on. Cheers.