--- id: 60fad1cafcde010995e15306 title: Step 41 challengeType: 0 dashedName: step-41 --- # --description-- Per quanto riguarda l'invio dei moduli, è utile oltre che una buona pratica, fornire ogni elemento inviabile di un attributo `name`. Questo attributo è utilizzato per identificare l'elemento una volta che il modulo è stato inviato. Dai a ogni elemento inviabile un attributo `name` univoco di tua scelta, a eccezione dei due elementi `radio`. # --hints-- Dovresti assegnare all'`input` relativo al nome un attributo `name`. _PS Io avrei scelto `first-name`_ ```js assert.isNotEmpty(document.querySelector('fieldset:nth-child(1) > label:nth-child(1) > input')?.name); ``` Dovresti assegnare all'`input` relativo al cognome un attributo `name`. _PS Io avrei scelto `last-name`_ ```js assert.isNotEmpty(document.querySelector('fieldset:nth-child(1) > label:nth-child(2) > input')?.name); ``` Dovresti assegnare all'`email` un attributo `name`. _PS Io avrei scelto `email`_ ```js assert.isNotEmpty(document.querySelector('input[type="email"]')?.name); ``` Dovresti assegnare alla `password` un attributo `name`. _PS Io avrei scelto `password`_ ```js assert.isNotEmpty(document.querySelector('input[type="password"]')?.name); ``` Dovresti assegnare alla `checkbox` un attributo `name`. _PS Io avrei scelto `terms`_ ```js assert.isNotEmpty(document.querySelector('input[type="checkbox"]')?.name); ``` Dovresti assegnare al `file` un attributo `name`. _PS Io avrei scelto `file`_ ```js assert.isNotEmpty(document.querySelector('input[type="file"]')?.name); ``` Dovresti assegnare al `number` un attributo `name`. _PS Io avrei scelto `age`_ ```js assert.isNotEmpty(document.querySelector('input[type="number"]')?.name); ``` Dovresti assegnare all'elemento `select` un attributo `name`. _PS Io avrei scelto `referrer`_ ```js assert.isNotEmpty(document.querySelector('select')?.name); ``` Dovresti assegnare all'elemento `textarea` un attributo `name`. _PS Io avrei scelto `bio`_ ```js assert.isNotEmpty(document.querySelector('textarea')?.name); ``` Non dovresti assegnare a nessun elemento `option` un attributo `name`. ```js [...document.querySelectorAll('option')]?.forEach(option => assert.isUndefined(option?.name)); ``` Non dovresti assegnare a nessun elemento `label` un attributo `name`. ```js [...document.querySelectorAll('label')]?.forEach(label => assert.isUndefined(label?.name)); ``` Non dovresti assegnare a nessun elemento `fieldset` un attributo `name`. ```js [...document.querySelectorAll('fieldset')]?.forEach(fieldset => assert.isEmpty(fieldset?.name)); ``` # --seed-- ## --seed-contents-- ```html Registration Form

Registration Form

Please fill out this form with the required information

--fcc-editable-region--
--fcc-editable-region--
``` ```css body { width: 100%; height: 100vh; margin: 0; background-color: #1b1b32; color: #f5f6f7; } label { display: block; margin: 0.5rem 0; } ```