But when I attached that form with submit() function the form submitted to no where. To tackle this we can have a simple solutions.
From a several uses of return false, this can be used in telling the function not to submit the form. Its easy to make, first create a form like:
<input type='search' class='searchbar'>
// Do some magic here!
return false; // this is what stops form to submit