Skip to content
Advertisement

Javascrit .createTextNode output is giving errors

I created a website where it tells you your age. I use document.createTextNode to store the output but the output is not working properly. Here is the output code

JavaScript

When I run my code, it only outputs the first part, “You are”. Is there any way to output the entire message.

Advertisement

Answer

In JavaScript you use + instead of . to concatenate strings.

working example

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement