Ask coding questions

← Back to all posts
add html code in node
floribert10

hi,
How can i add html code in node.js.
Help me pls

thanks

Answered by JBloves27 [earned 5 cycles]
View Answer
Voters
TANMAYBAGADIA
floribert10
Comments
hotnewtop
JBloves27

Or you can do this:
HTML

JAVASCRIPT

This should work. Hope it helps!

floribert10

@JBloves27 yes! thanks

JBloves27
JBloves27

You can use the following example:

Then it should display this:

Hello World!

Hope this helps!

TANMAYBAGADIA

@JBloves27 yup this is one way

JBloves27
IntellectualGuy

@JBloves27 Bruh that's JavaScript not Node.js. Node.js can't access the DOM.

JBloves27

grimace yeah, my bad @IntellectualGuy

TANMAYBAGADIA

Like do you want to render a html page or just to write the html tags in node.js

floribert10

@TANMAYBAGADIA html page

TANMAYBAGADIA

@floribert10 Ohk you got the answer now . Plz mark the guy who answered your question if it seems to you was what you were looking for as it would sort the questions

Coder100

Lmao that's not node.js

floribert10

thanks!!