What is the use of val() method in JQuery?

What is the use of val() method in JQuery?

It returns or sets the value attribute of the selected elements. It is mostly used in HTML form elements.