Changing the label or a message is often required in an application. For example, on a registration page there is a validation required to fill all the fields on click of a button. Instead of showing an alert message, a message in a label looks quiet good in the form. Its more user frieldly.
To update a label, for property is used and a new html is appended to the for property name of the label.
To use the inbuilt function in JS, following library must be included in the HTML file
Here is the sample html code to change the label value on click of a button