diff --git a/01/app.js b/01/app.js index 1c9992e..4900ecf 100644 --- a/01/app.js +++ b/01/app.js @@ -1 +1,10 @@ -console.log('DOM'); \ No newline at end of file +console.log("DOM"); + +const element = document.querySelector( + ".comments__item.comments__item--newest" +); + +if (element) { + const dataSetElement = element.querySelectorAll("[data-info]"); + console.log(dataSetElement.length); +} diff --git a/02/app.js b/02/app.js index 1c9992e..4a044fa 100644 --- a/02/app.js +++ b/02/app.js @@ -1 +1,9 @@ -console.log('DOM'); \ No newline at end of file +console.log("DOM"); + +const dataUrl = document.querySelectorAll("[data-url"); +dataUrl.forEach(function (el) { + const url = el.dataset.url; + if (!el.hasAttribute("href")) { + el.setAttribute("href", url); + } +}); diff --git a/02/index.html b/02/index.html index 89a53f6..41ba13e 100644 --- a/02/index.html +++ b/02/index.html @@ -1,20 +1,24 @@ -
- - - - + + + + +