How can I get the title of an HTML page with JavaScript?
Use document.title:
document.title
console.log(document.title)
<title>Title test</title>
MDN Web Docs