Home

This is a really cool JavaScript example!

HTML

<!doctype html>
<html>
<head>
  <title>Cool JavaScript example</title>
  <meta charset = "utf-8" >
  <link rel = "stylesheet" href = "css/CoolJavaScript.css" />
</head>
<body>

<header id = "top">
  <h1>This is a really cool JavaScript example!</h1>
</header>

<section>
  <video src = "video/cometAnim.mp4" width = "320" height = "250" autoplay controls >
  </video>
  
  <hr>
 
  <h2>Famous Presidential Quotes</h2>

  <form>
    <input type = "button" value = "Lincoln"
        onClick = "saySomething( 'Four score and seven years ago ...' )" >
    <input type = "button" value = "Kennedy"
        onClick = "saySomething( 'Ask not what your country can do for you ...' )" >
    <input type = "button" value = "Nixon"
        onClick = "saySomething( 'I am not a crook!' )" >
  </form>

</section>

<hr>

<a href = "#top" >Back to top</a>

<footer>
I hope you had a good visit!
</footer>

<script>
  <!-- Hide script from old browsers

  function saySomething( message ) {
    alert( message )
  }

  // Ending hiding script from older browsers -->
</script>

</body>
</html>

CSS

body {
  background-color: lightgreen;
}

header {
  text-align: center;
}

nav {
  width: 10%;
  height: 32em;
  float: left;
  font-size: 150%;
}

footer {
  text-align: center;
  font-weight: bold;
  font-size: 400%;
}

a {
  font-size: 150%;
}

JavaScript

<script>
  <!-- Hide script from old browsers

  function saySomething( message ) {
    alert( message )
  }

  // Ending hiding script from older browsers -->
</script>

Famous Presidential Quotes


Back to top
Home