我正在使用Razor视图引擎生成一个使用此代码的RadioButton项目列表,我的css和Javascript是
.radioSelection
{
color: Green;
font-weight: bold;
}
$(document).ready(function () {
$("input[name=ScoreId]:radio").change(function () {
//How can i access the label span of current selection & reset the old selection
});
});
@foreach (var item in model)
{
<li class="radio clearfix ui-sortable-handle">
@Html.RadioButton("ScoreId", statement_item.Id, new { @class = "" })
<span class="lbl" >@statement_item.Statement</span>
</li>
}如何将类radioSelection设置为选定的radiobuttonList项,以及如何在选择新的无线电项时将旧项的选择重置为正常
发布于 2015-04-28 04:34:06
试试- $(this).siblings('span.lbl')。
https://stackoverflow.com/questions/29910387
复制相似问题