| <html> |
| <head> |
| <title>Original Title</title> |
| <script> |
| function debugOutput(str) { |
| text = document.createTextNode(str); |
| debugDiv = document.getElementById('debugDiv'); |
| div = document.createElement ('div'); |
| div.appendChild(text); |
| debugDiv.appendChild(div); |
| } |
| |
| function runTests() { |
| if (window.layoutTestController) { |
| layoutTestController.dumpAsText(); |
| layoutTestController.dumpTitleChanges(); |
| } |
| |
| titleElem = document.getElementsByTagName('title').item(0); |
| debugOutput ('Original title is: ' + titleElem.text); |
| |
| newTitle = 'This is the new title'; |
| debugOutput ('Setting new title to: ' + newTitle); |
| titleElem.text = newTitle; |
| |
| debugOutput ('New title is: ' + titleElem.text); |
| } |
| |
| function test() { |
| t = document.getElementsByTagName('title').item(0); |
| alert (t.text); |
| t.text = 'new title'; |
| alert (t.text); |
| } |
| </script> |
| </head> |
| <body onload='runTests();'> |
| <div id='debugDiv'> |
| </div> |
| </body> |
| </html> |