我有一个表格,我有我下面的过滤器按钮(应用过滤器&清除过滤器)我想显示“清除”时,“应用”按钮点击时隐藏“清除”按钮。隐藏一个“清除”按钮,直到“应用”按钮,点击
下面的代码,如果我有我的表:
<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