The slider control (<input type="range"), sometimes referred to as a slider bar, displays a
bar with an adjustment knob that a user can drag with their mouse pointer. As the user drags the knob,
the slider control returns a numerical value which is within the range specified by the values
assigned by the coder to the min and max attributes of the control.
Most browser renderings of a slider control do not display the numerical values for various locations
of the knob, so the slider control is not designed for precision settings. The basic html code for a slider
control is shown below.
Shown below is some practical code to access the contents of the slider control. The additional
attributes are id which allows the JavaScript getElementById method to access the
element, and the onchange event to call the JavaScript function.
Note that since the slider control itself does not display a value, the displayNumber function
is called by the window.onload event to display the initial value assigned by the coder.