1
我想在該歌曲的相應按鈕被按下時顯示專輯名稱和類別元素。我該怎麼做呢?這是我目前的jquery。謝謝你的幫助。點擊按鈕時jquery切換元素
$('.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" })
}
我看不出怎麼會工作。請舉例? – sitBy
我給你鏈接到文檔的例子。你沒有給html –