<html>
<body>
<h1>The Element Object</h1>
<h2>The title Property</h2>
<p>Hover over the 'w3schools.com' header (to see the title), before and after you click "Change".</p>
<h2 id="myH2" title="Free Web tutorials">w3schools.com</h2>
<button onclick="myFunction()">Change</button>
<script>
function myFunction() {
const element = document.getElementById("myH2");
element.title = "The World's Largest Web Development Site";
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_element_title2 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:39:46 GMT -->
</html>