MVC Jquery toggle elements when button is clicked
I want to show the album name and category element when the corresponding button is pressed for that song. How do I do this? This is the jquery I have at the moment. Thanks for any help.
-
$('.song-list-btn').each(function(i, obj) { $(this).on('click', function () { }); }); foreach (var item in Model) { <button class="song-list-btn" type="button"> <span class="fa fa-bars" aria-label="Song Details Menu"></span> </button> @Html.EditorFor(model => item.AlbumName, new { htmlAttributes = new { @class = "form-control details", @placeholder = "Album Name" } }) @Html.ValidationMessageFor(model => item.AlbumName, "", new { @class = "text-danger" }) @Html.EditorFor(model => item.Category, new { htmlAttributes = new { @class = "form-control details", @placeholder = "Category Name" } }) @Html.ValidationMessageFor(model => item.Category, "", new { @class = "text-danger" }) }