EM demonstration

by myrluk3

HTML

<button id="px10">10</button>
<button id="px15">15</button>
<button id="px20">20</button>
<br>
<div class="header">Header text</div>
<div class="normal">Normal text</div>
<div class="table">Table text</div>

CSS

.px15 {
  font-size: 15px;
}

.px20 {
  font-size: 20px;
}

.px10 {
  font-size: 10px;
}

.header {
  font-size: 1.5em;
}

.normal {
  font-size: 1em;
}

.table {
  font-size: .8em;
}

JavaScript

$('button').click(function() {
	$('body').removeClass();
  //console.log(this.id);
  $('body').addClass(this.id);
});