Edit This Code:
<!DOCTYPE html>
<html>
<body>

<p>Click the button to change the title of the p element below.</p>

<p id="myP" title="Free Web tutorials">w3schools.com</p>

<button onclick="myFunction()">Try it</button>

<p><strong>Tip:</strong> Hover over the 'w3schools.com' text before and after you click the button.</p>

<script>
function myFunction() {
    document.getElementById("myP").title = "The World's Largest Web Development Site";
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy