I'm trying to simply change the text inside all </p>
elements with this code
<html>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<body>
<p></p>
<script>
elem=document.getElementsByTagName("p");
elem.innerHTML="work";
</script>
</body>
</html>
from this I expect work
to appear on the page, but the result is just a blank page with no text. why?