--- id: 615f7ecb09de9a938ef94756 title: Step 54 challengeType: 0 dashedName: step-54 --- # --description-- Aggiungi un altro elemento `p` con il testo `Total Carbohydrate 37g 13%`. Come prima, usa gli elementi `span` per rendere il testo `Total Carbohydrate` in grassetto, e il testo `13%` in grassetto e allineato a destra. # --hints-- Dovresti creare un nuovo elemento `p` alla fine dell'elemento `.daily-value.sm-text`. ```js assert(document.querySelector('.daily-value.sm-text')?.lastElementChild?.localName === 'p'); ``` Il nuovo elemento `p` dovrebbe avere il testo `Total Carbohydrate 37g 13%`. ```js assert(document.querySelector('.daily-value.sm-text')?.lastElementChild?.innerText?.match(/Total Carbohydrate 37g[\s|\n]+13%/)); ``` Il nuovo elemento `p` dovrebbe avere due elementi `span`. ```js assert(document.querySelector('.daily-value.sm-text')?.lastElementChild?.querySelectorAll('span')?.length === 2); ``` Il primo elemento `span` dovrebbe avere l'attributo `class` con il valore `bold`. ```js assert(document.querySelector('.daily-value.sm-text')?.lastElementChild?.firstElementChild?.classList?.contains('bold')); ``` Il primo elemento `span` dovrebbe racchiudere il testo `Total Carbohydrate`. ```js assert(document.querySelector('.daily-value.sm-text')?.lastElementChild?.firstElementChild?.innerText === 'Total Carbohydrate'); ``` Il secondo elemento `span` dovrebbe avere l'attributo `class` con il valore `bold right`. ```js assert(document.querySelector('.daily-value.sm-text')?.lastElementChild?.lastElementChild?.classList?.contains('bold')); assert(document.querySelector('.daily-value.sm-text')?.lastElementChild?.lastElementChild?.classList?.contains('right')); ``` Il secondo elemento `span` dovrebbe racchiudere il testo `13%`. ```js assert(document.querySelector('.daily-value.sm-text')?.lastElementChild?.lastElementChild?.innerText === '13%'); ``` # --seed-- ## --seed-contents-- ```html
8 servings per container
Serving size 2/3 cup (55g)
Amount per serving
% Daily Value *
Total Fat 8g10%
Saturated Fat 1g 5%
Trans Fat 0g
Cholesterol 0mg 0%
Sodium 160mg 7%
--fcc-editable-region--