diff --git a/02/app.js b/02/app.js index 1c9992e..105c609 100644 --- a/02/app.js +++ b/02/app.js @@ -1 +1,16 @@ -console.log('DOM'); \ No newline at end of file +document.addEventListener('DOMContentLoaded', function () { + const links = document.querySelectorAll('a[data-url]'); + + links.forEach(link => { + const url = link.getAttribute('data-url'); + + if (url !== 'null') { + link.setAttribute('href', url); + } else { + link.style.color = 'grey'; + link.addEventListener('click', function (event) { + event.preventDefault(); + }); + } + }); +});