From c7bf00da9d1b960defd59f48d2e8ecf887fd90e2 Mon Sep 17 00:00:00 2001 From: Nikolay Date: Mon, 2 Sep 2024 21:38:01 +0500 Subject: [PATCH] 5-modul --- 4-module/3-task/index.js | 2 +- 5-module/2-task/index.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/4-module/3-task/index.js b/4-module/3-task/index.js index 71db56a..a5fd632 100644 --- a/4-module/3-task/index.js +++ b/4-module/3-task/index.js @@ -18,7 +18,7 @@ function highlight(table) { row.classList.add ('female'); } if (parseInt (ageCell.textContent) < 18) { - ageCell.style.textDecoration = 'line-through'; + row.style.textDecoration = 'line-through'; } });// ваш код... } diff --git a/5-module/2-task/index.js b/5-module/2-task/index.js index 7a8a3b8..817854b 100644 --- a/5-module/2-task/index.js +++ b/5-module/2-task/index.js @@ -1,3 +1,11 @@ function toggleText() { - // ваш код... + const button = document.querySelector ('.toggle-text-button'); + const textElement = document.getElementById ('text'); + button.addEventListener ('click', function () { + if (textElement.hasAttribute ('hidden')) { + textElement.removeAttribute ('hidden'); + } else { + textElement.setAttribute ('hidden', true); + } + });// ваш код... }