I want to get posted data using jquery. I have implemen
Html Form
<form id="login_form" action="userPref.php" method="post" >
<div hidden id="error" style="color:red; text-align:center;" > <p> user not found </p> </div>
<div class="form-group">
<label for="usrname"><span class="glyphicon glyphicon-user "></span> User Id</label>
<input type="text" value="" class="form-control" required="required" id="usrname" name="usrname" placeholder="Enter User Id" >
</div>
<button type="submit" id="login" class="btn btn-success btn-block"><span class="glyphicon glyphicon-off"></span> Login</button>
</form>
In userPref.php I am using php to get data but I actually want to use jquery
var userid = <?php echo $_POST["usrname"] ?>;
I have also tried to access the form data using jquery but I was not able to access the data. Please help me.