Cómo obtener datos de la página HTML usando JavaScript

<p id="par">hi</p>
<!--put script in head tag-->
<script type="text/javascript">
	document.getElementById('par')//then whatever u want to do with it like window.location or something//
</script>
Daiwikrox bruh