freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-by-building-a-ca.../5ef9b03c81a63668521804d6.md

2.5 KiB

id title challengeType dashedName
5ef9b03c81a63668521804d6 Step 35 0 step-35

--description--

Adesso aggiungerai un modulo web per raccogliere informazioni dagli utenti.

Dopo l'intestazione Cat Form, aggiungi un elemento form.

--hints--

L'elemento form dovrebbe avere un tag di apertura e un tag di chiusura. Potrebbero mancare uno o entrambi i tag richiesti, o essere nell'ordine sbagliato.

assert(document.querySelector('form') && code.match(/<\/form>/g));

I tag dell'elemento form non sono nell'ordine corretto.

const noSpaces = code.replace(/\s/g, '');
assert(noSpaces.indexOf('<form>') < noSpaces.indexOf('</form>'));

L'elemento form annidato nell'ultimo elemento section dovrebbe essere al di sotto dell'elemento h2. L'elemento h2 e l'elemento form sono nell'ordine sbagliato.

assert(document.querySelector('form').previousElementSibling.nodeName === 'H2');

L'elemento form non deve avere contenuti. Rimuovi qualsiasi elemento HTML o testo tra i tag dell'elemento form.

assert($('form')[0].innerHTML.trim().length === 0);

--seed--

--seed-contents--

<html>
  <body>
    <h1>CatPhotoApp</h1>
    <main>
      <section>
        <h2>Cat Photos</h2>
        <!-- TODO: Add link to cat photos -->
        <p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
        <a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
      </section>
      <section>
        <h2>Cat Lists</h2>
        <h3>Things cats love:</h3>
        <ul>
          <li>cat nip</li>
          <li>laser pointers</li>
          <li>lasagna</li>
        </ul>
        <figure>
          <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna.jpg" alt="A slice of lasagna on a plate.">
          <figcaption>Cats <em>love</em> lasagna.</figcaption>  
        </figure>
        <h3>Top 3 things cats hate:</h3>
        <ol>
          <li>flea treatment</li>
          <li>thunder</li>
          <li>other cats</li>
        </ol>
        <figure>
          <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg" alt="Five cats looking around a field.">
          <figcaption>Cats <strong>hate</strong> other cats.</figcaption>  
        </figure>
      </section>
      <section>
--fcc-editable-region--
        <h2>Cat Form</h2>
--fcc-editable-region--
      </section>
    </main>
  </body>
</html>