How do you show the value of a TextBox to a label?
JavaScript function to Display (Copy) TextBox value to Label
First the TextBox and then the Label elements are referenced and then the value of the TextBox is assigned to the Label element using JavaScript. //Reference the TextBox. var txtName = document. getElementById("txtName");
What is label and TextBox?
Labels are for text to be displayed (info for the user), TextBox are when you need to get input from your user or you need an edit operation or allow a copy (Ctrl+C) of the text even when you don't want any editing. Of course TextBox are more heavy in terms of system resources but the difference is negligible.