Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript alternative to jquery html()

How would you write this jQuery method

$('body').html(node); 

for setting html to node in Javascript?

thank you

like image 913
xralf Avatar asked Nov 27 '22 18:11

xralf


1 Answers

Yes thats possible:

document.body.innerHTML="<h1>Hello World</h1>";

http://www.tizag.com/javascriptT/javascript-innerHTML.php

like image 120
jantimon Avatar answered Dec 05 '22 03:12

jantimon