‹ jQuery

.val()

Lee o cambia el valor de un campo de formulario: input, select o textarea.

Vista previa

Codigo

ejemplo.html
<input id="campo" type="text">
<p id="salida"></p>
<script>
  $("#campo").val("Texto puesto con jQuery");
  $("#salida").text("Valor actual: " + $("#campo").val());
</script>