Basically there is a google like search bar, once they submit, I need to store it in a variable. There is more to the jQuery than below, but all it is is document.ready. The reason I need the data in a variable is because after that, I will use $.post and send it to my api.
the jQuery:
("#form").submit( function(res) {
var id = $(this).JSON.parse(data);
//Other attempted ways of getting input.
//$(this).data
//$(this).data('button')
//document.getElementById('id').value
//$(this).getElementById('id').value
//$(this).JSON.parse(data) -> "caot parse undenfined, means no JSON data."
html
<form id = "form">
<div class="featurette">
<div class = "featurette-ier text-center">
<div class= "search">
<div class="input-group input-group-lg">
<span class="input-group-btn">
<button class="btn btn-danger" type="submit">Search</button>
</span>
<input type="text" name = "id" input id = "searchbar" class="form-control" placeholder="Enter your search term....">
</div>
</div>
</div>
</form>
