Answers for "how to put javascript in body"

1

reference body js

var body = document.getElementsByTagName("BODY")[0]; //bad way
document.body //good way
Posted by: Guest on November-22-2020
0

represent body in javascript

// for defining body getElementyId or any other syntax won't be used and for that we have to write 
document.body.style.backgroundColor = "yellow";
Posted by: Guest on March-20-2021

Code answers related to "how to put javascript in body"

Code answers related to "Javascript"

Browse Popular Code Answers by Language