<h1>JavaScript Classes</h1>

<p>First Name: <span id="fname"></span></p>
<p>Last Name: <span id="lname"></span></p>
<p>Birthday: <span id="bday"></span></p>

<br />

<p>First Name: <span id="fname2"></span></p>
<p>Last Name: <span id="lname2"></span></p>
<p>Birthday: <span id="bday2"></span></p>

<br />

<p>First Name: <span id="fname3"></span></p>
<p>Last Name: <span id="lname3"></span></p>
<p>Birthday: <span id="bday3"></span></p>
class Person {
  constructor(fname,lname,bday) {
    this.fname = fname;
    this.lname = lname;
    this.bday = bday;
  }
}

class Person2 {
  constructor(fname,lname,bday = '01/01/1900') {
    this.fname = fname;
    this.lname = lname;
    this.bday = bday;
  }
}

let Joe = new Person("Joe","Steinbring","01/01/1965");

document.getElementById("fname").innerHTML = Joe.fname;
document.getElementById("lname").innerHTML = Joe.lname;
document.getElementById("bday").innerHTML = Joe.bday;

let Janice = new Person2("Janice","Doe");

document.getElementById("fname2").innerHTML = Janice.fname;
document.getElementById("lname2").innerHTML = Janice.lname;
document.getElementById("bday2").innerHTML = Janice.bday;

let Tim = new Person2("Tim","Smith","09/17/2001");

document.getElementById("fname3").innerHTML = Tim.fname;
document.getElementById("lname3").innerHTML = Tim.lname;
document.getElementById("bday3").innerHTML = Tim.bday;

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.