We can access the text of the paragraph through the variable element, by using .innerHTML.

<html>
<body>
<h3>Tweeter</h3>
<p id="messages">New Messages</p>
<script>
var pElement = document.getElementById("messages");
console.log(pElement.innerHTML)
</script>
</body>
</html>]]>

Make sure to pick element, followed by ., and finally innerHTML.