0
I’m trying to store in a var, and then reinsert into the body 3 elements of the type "p".
<body>
<p> Um</p>
<p> Dois </p>
<p> Tres </p> ....
In doing so:
<script>
var parag = document.querySelectorAll("p");
document.write(parag);
</script>
What I have printed on the screen is a kind of "label" or object list name (for DOM, or elements, pro html, correct?) "p":
Print like this:
[Object Nodelist]
Now, is there any way I can get those elements "p", and effectively reprint its contents in the body??
querySelectorAll
return aNodeList
logo to use each of the elements needs afor
. A short time ago I answered a question very similar to yours if not duplicated. See here– Isac