jquery code to read value of input field code example

Example 1: jquery value of input

$("#textInput").val() // To get value of element textInput

Example 2: get value of input jqueyr

var str = $("#myInput"). val();

Example 3: javascript jquery get form field value

$(document).ready(function(){
         
             $("#buttonSet").click(function () {
                 $("#txtBox").val("Amit");
                 $("input:radio").val(["male"]);
                 $("#buttonGet").removeAttr('disabled');
            });
             $("#buttonGet").click(function () {
                $("#result").html(
                    $("#txtBox").val() + "<br/>" +
                    $("input:radio[name=rd]:checked").val()
                );
            });
         });

Tags:

Html Example