Javascript examples for DOM:Element title
Element title Property - Change the title of a <p> element:
<!DOCTYPE html> <html> <body> <p id="myP" title="Free Web tutorials">java2s.com</p> <button onclick="myFunction()">Test</button> <script> function myFunction() {//from ww w. ja va 2s . co m document.getElementById("myP").title = "a title"; } </script> </body> </html>