js.html 823 B

1234567891011121314151617181920212223242526272829303132
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MuJS demo</title>
  6. <style>
  7. body { background-color: #101018; color: #e0e0e8; margin: 24px; }
  8. h1 { color: #7fb0ff; }
  9. #out { color: #80d090; }
  10. li { margin: 6px 0; }
  11. </style>
  12. </head>
  13. <body>
  14. <h1>MuJS demo</h1>
  15. <p id="out">The script has not run yet.</p>
  16. <ul>
  17. <li>2 + 3 = <b id="sum">?</b></li>
  18. <li>Math.sqrt(16) = <b id="sqrt">?</b></li>
  19. <li>Date: <span id="date">?</span></li>
  20. </ul>
  21. <script>
  22. document.getElementById('sum').textContent = String(2 + 3);
  23. document.getElementById('sqrt').textContent = String(Math.sqrt(16));
  24. document.getElementById('date').textContent =
  25. new Date().toISOString();
  26. document.getElementById('out').textContent =
  27. 'Inline JavaScript is running.';
  28. console.log('MuJS demo: ' + location.href);
  29. alert('MuJS demo ran');
  30. </script>
  31. </body>
  32. </html>