JSFiddle - React, Tailwind, and code Playground

by blue1086

HTML

<input id="start" placeholder="Start Number">
<input id="end" placeholder="End Number">
<input id="by" placeholder="Multiply By">
<br/>
<button id="go">Go!</button>

<div id="results">
</div>

JavaScript

document.getElementById('go').onclick = function () {
  var start = document.getElementById('start').value,
      end   = +document.getElementById('end').value,
      by    = +document.getElementById('by').value,
      i = 0;
  
    console.log(start,end,by,i);
    
  document.getElementById('results').innerHTML = "";
  
  for (i = 1; i < end + 1; i += 1) {
      console.log(i);
    document.getElementById('results').innerHTML += i + " times " + by + " is " + (i*by) + "<br/>";
  }
}