How to find HTML element with getElementById in JavaScript

1 Answer

0 votes
<!DOCTYPE html>
<html>
<body>

<p id="p-id"></p>

<script>

document.getElementById("p-id").innerHTML = "hello";

/*
run:

hello

*/

</script>

</body>
</html>

 



answered Jul 5, 2015 by avibootz

Related questions

...