task-05.js 644 B

1234567891011121314151617181920
  1. // confirm: if this days
  2. // Сделать тоже самое с помощью if.
  3. const f5 = (rootId) => {
  4. const task05block = document.createElement('div');
  5. const task05title = document.createElement('h2');
  6. task05title.innerText = 'Task-05 Confirm: if this days';
  7. const talk05Btn = document.createElement('button');
  8. talk05Btn.innerText = "Lets talk again";
  9. talk05Btn.style = 'margin-bottom:20px';
  10. rootId.appendChild(task05block);
  11. task05block.appendChild(task05title);
  12. task05block.appendChild(talk05Btn);
  13. talk05Btn.onclick = () => {
  14. if (!confirm('Шоппинг?')) { alert("ты - бяка") }
  15. }
  16. }
  17. f5(root);
  18. export default f5;