E-3_Fall_2017: Fiddle 1

JavaScript Console and Dialog Boxes.

by Aboubacar Bah

HTML

<h1>
  CSCI E-3
  <br />Introduction to Web Programming Using JavaScript
</h1>
<h2 id="hvd">
  Harvard Extension School
  <br />Fall, 2017
</h2>
<h3 class="tf">TF: Rob Frenette</h3>
<div>
  JavaScript Console and Dialog Boxes.
  <br />Open JavaScript Console to see results.
</div>

CSS

/* assign color by HTML tag */
h1 {
  color: #00498F;
}

/* assign color by id attribute */
#hvd {
  color: #A51C30;
}

/* assign color by class attribute */
.tf {
  color: #677984;
}

JavaScript

"use strict";

// This is a single line comment.

/*
  This is a multi line comment.
  Lorem Ipsum.
*/

// clear the JavaScript Console
console.clear();

// write greeting to the console
console.log('Hello, JSFiddle!');

// declare varaible to hold greeting.
var greeting = 'Hello, JSFiddle!';

// write greeting to console using data in var
console.log(greeting);

// alert greeting
alert(greeting);

// prompt user for first name
//var firstName = prompt('Please enter your First Name.');
// greet user
//alert('Hello, ' + firstName + '!');

// confirm dialog
//var userResponse = confirm("Press a button!");
//console.log('You clicked: ' + userResponse);

// reuse existing var
//userResponse = confirm("Press the other button!");
//console.log('You clicked: ' + userResponse);