This is one of main purposes of JavaScript. For example, you can get an input control object using
getElementById
and then use its property
value
. In case of text input, it will be the text in the text box. Please see:
http://www.tizag.com/javascriptT/javascript-getelementbyid.php[
^],
http://www.w3schools.com/tags/tag_input.asp[
^].
Starting from any element, you can also get the whole DOM model of the whole document of its part. Please start here:
http://www.w3schools.com/jsref/default.asp[
^],
http://www.w3schools.com/jsref/dom_obj_document.asp[
^].
It's more convenient to work with HTML DOM elements using jQuery:
http://en.wikipedia.org/wiki/Jquery[
^],
http://jquery.com/[
^].
For example, this is the equivalent of
getElementById
:
inputElement = $("#myTextBox");
value = inputElement.val();
Please see:
http://api.jquery.com/id-selector/[
^],
http://api.jquery.com/category/selectors/[
^],
http://api.jquery.com/val/[
^].
Major DOM navigation is done using
traversing methods:
http://api.jquery.com/category/traversing/[
^].
If you need to learn jQuery, start here:
http://docs.jquery.com/Tutorials[
^],
http://docs.jquery.com/Tutorials:How_jQuery_Works[
^].
—SA