<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);
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.