r/learnjavascript • • Mar 24 '23

This is driving me nuts........

2 Upvotes

4 comments sorted by

5

u/shuckster Mar 24 '23

Line 23 says createParagraph instead of dangerButton.

But I think the real problem is... you pressed the button.

1

u/Username_1987_ Mar 24 '23

I thought 'function " " ' could be away to give the string actual function.....

edit: Also.... I changed it and it solved the problem.

3

u/[deleted] Mar 24 '23

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

1

u/HaroerHaktak Mar 24 '23

You should make it so the font-size either changes randomly or always grows 1px larger.