Https://www.codecademy.com/paths/web-development/tracks/building-interactive-javascript-websites/modules/web-dev-interactive-websites/lessons/javascript-dom/exercises/create-element


#1

Hey,
Just curious about innerHTML, attached the link.
The explanation shows how to use innerHTML like this.
paragraph.innerHTML('The text inside paragraph');
it didn’t work, the solution says
paragraph.innerHTML = 'The text inside paragraph';
and it works.

Is there any ways to use it like the explanation?

Thanks
HJ


#2

no, the explanation is just wrong. innerHTML is a property, not a method.


#3

Thanks! properties go like = “” ; and methods go like (’’); then.
Have a nice day