Although and are different elements, they both support the same feature to get the text contained in the text box. Consider the following example: Copy the code The code is as follows: < ;head>Retrieying a Textbox Value Example<br>function getValues(){<br>var oTextbox1=document. getElementById("txt1");<br>var oTextbox2=document.getElementById("txt2");<br>alert("The value of txt1 is "" oTextbox1.value ""n" <br>"The value of txt2 is"" oTextbox2.value """);<br>}<br>