function dangerButton is declaring a function called dangerButton but not doing anything with it
addEventListener('click', dangerButton) On this line you are passing that function into addEventListener, which will then execute your function when the click event occurs
in your code above, createParagraph has never been declared and therefore is not defined
Next time, look in the dev tools console to see what error messages it is giving you, you would have been getting "error createParagraph is not defined", which would have helped you find out what was going wrong
5
u/shuckster Mar 24 '23
Line 23 says
createParagraphinstead ofdangerButton.But I think the real problem is... you pressed the button.