On Change update ()

by Santosh Thakur

HTML

<div>
  <input id="fontSize" type="number">
</div>
<div id="testDrive">Where do we want to end up? What is our ultimate destination?Most people find that the path to self actualization and spiritual enlightenment turns out to be not as straight or direct as it had originally appeared</div>

CSS

input[type=number] {
  font-size: 20px;
  -moz-appearance: textfield;
  appearance: textfield;
  margin: 0;
}

JavaScript

(function() {

  var fontSize = document.getElementById('fontSize'),
    testDrive = document.getElementById('testDrive');

  function updateTest() {
    alert();
    testDrive.innerHTML = testText.value || String.fromCharCode(160);
    if (window.icomoonLiga) {
      window.icomoonLiga(testDrive);
    }
  }

  function updateSize() {
    testDrive.style.fontSize = fontSize.value + 'px';
  }

  fontSize.addEventListener('change', updateSize, false);
  testText.addEventListener('input', updateTest, false);
  //updateSize();


})()