The form is actually submitting causing your Javascript to be ignored. Prevent the default event using the following script:
function search_click(event){
event.preventDefault();
window.location.replace("http://stackoverflow.com");
}
HTML
<form class="form-wrapper cf">
<input type="text" placeholder="Enter keywords..">
<button onclick="search_click(event);">Search</button>
</form>