How can I get the title of an HTML page with JavaScript?
How can I get the title of an HTML page with JavaScript?
this makes the h1 element the page title. this shows how capable can be javascript for small and big projects.
document.getElementById("text").innerText = document.title;
<title>hello world</title>
<h1 id="text"></h1>