html5complete.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!doctype html>
  2. <head>
  3. <title>CodeMirror: HTML completion demo</title>
  4. <meta charset="utf-8"/>
  5. <link rel=stylesheet href="../doc/docs.css">
  6. <link rel="stylesheet" href="../lib/codemirror.css">
  7. <link rel="stylesheet" href="../addon/hint/show-hint.css">
  8. <script src="../lib/codemirror.js"></script>
  9. <script src="../addon/hint/show-hint.js"></script>
  10. <script src="../addon/hint/xml-hint.js"></script>
  11. <script src="../addon/hint/html-hint.js"></script>
  12. <script src="../mode/xml/xml.js"></script>
  13. <script src="../mode/javascript/javascript.js"></script>
  14. <script src="../mode/css/css.js"></script>
  15. <script src="../mode/htmlmixed/htmlmixed.js"></script>
  16. <style type="text/css">
  17. .CodeMirror {border-top: 1px solid #888; border-bottom: 1px solid #888;}
  18. </style>
  19. </head>
  20. <body>
  21. <div id=nav>
  22. <a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
  23. <ul>
  24. <li><a href="../index.html">Home</a>
  25. <li><a href="../doc/manual.html">Manual</a>
  26. <li><a href="https://github.com/codemirror/codemirror">Code</a>
  27. </ul>
  28. <ul>
  29. <li><a class=active href="#">HTML completion</a>
  30. </ul>
  31. </div>
  32. <article>
  33. <h2>HTML completion demo</h2>
  34. <p>Shows the <a href="xmlcomplete.html">XML completer</a>
  35. parameterized with information about the tags in HTML.
  36. Press <strong>ctrl-space</strong> to activate completion.</p>
  37. <div id="code"></div>
  38. <script type="text/javascript">
  39. window.onload = function() {
  40. editor = CodeMirror(document.getElementById("code"), {
  41. mode: "text/html",
  42. extraKeys: {"Ctrl-Space": "autocomplete"},
  43. value: document.documentElement.innerHTML
  44. });
  45. };
  46. </script>
  47. </article>
  48. </body>