返回当前文档的标题

  1. <html>
  2. <head>
  3. <title>My title</title>
  4. </head>
  5.  
  6. <body>
  7. 该文档的标题是:
  8. <script type="text/javascript">
  9. document.write(document.title)
  10. </script>
  11. </body>
  12.  
  13. </html>