I have a form where i have buttons below my filters (Apply Filter & Clear Filter) i am trying to display the 'Clear' when the 'Apply' button is clicked and hide the 'Clear' button when it is clicked.
The code below if what I have for my table:
<dl class="filterlist" style="margin-top: 0px">
<dt>
<label for="Environment">Environment</label>
</dt>
<dd>
@Html.DropDownList("EnvironmentDD", (IEnumerable<SelectListItem>)ViewBag.Environment, "- - All Environments - -",
new { @class = "ddstyle", @id = "Environment", @title = "Filter the table below by environment." })
</dd>
<dt>
<label for="Product">Product</label>
</dt>
<dd>
@Html.DropDownList("ProductDD", (IEnumerable<SelectListItem>)ViewBag.Product, "- - All Products - -",
new { @class = "ddstyle", @id = "Product", @title = "Filter the table below by product." })
</dd>
<dt>
<label for="TestType">Test Type</label>
</dt>
<dd>
@Html.DropDownList("TestTypeDD", (IEnumerable<SelectListItem>)ViewBag.TestType, "- - All Test Types - -",
new { @class = "ddstyle", @id="TestType", @title="Filter the table below by test type." })
</dd>
<dt>
<label for="TestScenario">Test Scenario</label>
</dt>
<dd>
@Html.DropDownList("ScenarioDD", (IEnumerable<SelectListItem>)ViewBag.Scenario, "- - All Test Scenarios - -",
new { @class = "ddstyle", @id="TestScenario", @title="Filter the table below by test scenario." })
</dd>
<dt> </dt>
<dd>
<button class="butstyle" id="ApplyFilter" type="submit" title="Click to apply any filters selected above.">
Apply Filter(s) <i class="fa fa-filter"></i>
</button>
<button class="butstyle" id="ClearFilters" title="Click to reset any filters set." style="display:none">
Clear Filter(s) <i class="fa fa-eraser"></i>
</button>
</dd>
</dl>
How can I do this or what's the best way to as I cant seem to get my head around it. I am using HTML5 & MVC5.
By default the button is set to:
style="display:none">