The result is twice the input value.
Input >>

Result >>
A copy of the JavaScript functions in the head element:

// sample-2-getElementById-functions.js
// This sample uses getElementById() to find the input areas
// there is a form, but it is ignored

// Reset values onload of the body
function loaded()
  {
  var input_area = document.getElementById("change-input");
  input_area.value = "";
  var result_area = document.getElementById("result");
  result_area.value = "";
  }

// input change event handler
// twice the number in the input area is put in the result area
function changeInput()
  {
  var input_area = document.getElementById("change-input");
  var result_area = document.getElementById("result");

  var input_value = parseFloat(input_area.value);
  if ( isNaN(input_value ) )
    {
    result_area.value = "";
    }
  else
    {
    result_area.value = 2 * input_value;
    }
  }