Jump to content

JavaScript Programming/Introduction/Example Code

From Wikiversity

example.html

[edit | edit source]
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="Cache-Control" content="no-cache">
  <meta http-equiv="Content-Security-Policy" content="script-src-elem 'unsafe-inline' 'self'">

  <title>Example</title>
  
  <!-- The following line loads the external script. -->
  <script defer src="example.js" async></script>

  <script>
    //script in head
    document.