I want to show a display:none
element on a click of anchor tag
using jQuery show()
function.
But it's showing the div
element for a moment and then vanished I used return false
and preventDefault
functions but it stops the redirection of anchor tag to a certain page.
How I can solve this?
<div id="assetlist" style="display:none">
@{
Html.RenderPartial("~/Views/Asset/_Asset_List.cshtml");
}
<!-- /.sidebar-menu -->
</div>
<script>
$(document).ready(function () {
$(".asset_managment").click(function(){
$("#assetlist").show();
});
});
</script>
<li class="nav-link" >
<a href="@Url.Action("Index", "Asset")" class="asset_managment">
<img class="img_position" src="@Url.Content("~/admin-lte/img/asset_managment_icon.png")" width="50" height="50" /> Asset Managment
</a>
</li>