Answer the question
In order to leave comments, you need to log in
Does document.body.children[0].innerHTML work correctly?
Hello.
There is a code:
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div>Пользователи:</div>
<ul>
<li>Маша</li>
<li>Вовочка</li>
</ul>
<!-- комментарий -->
</body>
</html>
var elem = document.body.children[0].innerHTML;
var elem = document.body.children[1].innerHTML;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question