How to Get Form Input Field Value and Store it in Variable in jQuery Using Javascript Full Project For Beginners

 

 

Welcome folks today in this blog post we will be getting form input field value and store it in variable in jquery using javascript.All the full source code of the application is shown below.

 

 

 

Get Started

 

 

 

In order to get started you need to make an index.html file and copy paste the following code

 

 

index.html

 

 

<!DOCTYPE html>
<html>
<head>
  <title>Your Title Here</title>
</head>
<body>
  <h1>My Form</h1>
  
  
  <form id="thisform" method="post">
    Enter Your Name
                           <br>
                     <input type="text" name="myname">
        </form>
</body>
</html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  <script type="text/javascript">
    $(function(){
      $('#thisform input[name=myname]').keyup(function(){
        var entered_name=$(this).val();
        $('#showhere').text(entered_name); 

      });
      


    });
    
  </script>

Leave a Reply