I want to send my input box value in my ajax call.
I am trying but not work.
My Input box
 <form>
     <input type="text" onkeydown="filter()" id="searchTxt" placeholder="Filter" value="" >
 </form>
My Javascript code
function filter()   
{
        filterText = $('#searchTxt').val();  
          $( ".pagination" ).html(totalOutput);
          $.ajax({
           type: "POST",
           url: ""+baseUrl+"userList4",
                   data: { searchText: filterText},
           success: function(msg) {
              $(".paginateData").html(msg);
           }
      });
}
Here filterText = $('#searchTxt').val(); always get null