I want to toggle a button(display) as show hide based on the drop down values, however when I click another button(search) the page reloads and the button(display) if earlier visible is set to hide as the toggle function I have written on .change function. I want the button(display) to be visible even after the page reloads
This is my cshtml code
<div id = "search-container">
@using (Html.BeginForm("Search","Home",Formthod.Post,new{id="values"})){
<table>
<tr>
<td>
@Html.DropDownListFor(m=>m.Search.clientID,Model.ClientList,"All",
new{id = "sp-client"}
</td>
</tr>
<tr>
<input type ="submit" value="search" id="search" value="search"/>
<input type ="button" value="display" id="display" value="display"/>
</tr>
}
<script>
$('#sp-client').change{ function(){
if($client.val()==32)
{$("display").show()}
else
{$("display").hide()}
}
}
</script>
Any advice would be helpful