"when I click on the button it still doesn't redirect"
Because you're using a button tag. Use an input tag with type=button like I did.
<input type="button" value="Search" onclick="doIdNumSearch();" />