How jQuery gets and sets form elements

  • 2020-03-30 01:45:56
  • OfStack

JQuery provides the val () method, which allows you to quickly get and set the values of the form's text boxes, radio buttons, and radio buttons.
Use val() with no arguments to get the value of the element
Given an argument with val(), you assign a value to an element

As follows:

//Get the value
//Set the value
$("select#mylist").val(" The first column ");

Related articles: