我有一個表格,我有我下面的過濾器按鈕(應用過濾器&清除過濾器)我想顯示「清除」時,「應用」按鈕點擊時隱藏「清除」按鈕。隱藏一個「清除」按鈕,直到「應用」按鈕,點擊
下面的代碼,如果我有我的表:
<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>
我該怎麼做或什麼是爲我似乎無法讓我的頭周圍的最好方式。我正在使用HTML5 & MVC5。
默認情況下,該按鈕設置爲:
style="display:none">
我寧願Ø做到這一點不帶Java/jQuery的可能的話 – murday1983
您可以使用「複選框黑客」。 [鏈接](http://stackoverflow.com/questions/11166580/css3-transitions-is-there-an-on-click-option-without-using-jquery) – RobinvdA
可能有人請爲此提供jQuery的,因爲我已經找到使用這將是最好的選擇。 AJ提供的那個似乎不起作用。即使在他們提供的小提琴 – murday1983