Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的代码:
<div class="rdoTest">@Html.RadioButton("rdoTest", "Test", new { @onchange = "rdoReportTypeChange(this,true,true)" }) Test </div>
我用了var rdoTest =$('#rdoTest');rdoTest.hide();
var rdoTest =$('#rdoTest');rdoTest.hide();
只有单选按钮隐藏,但文本 ( Test) 没有隐藏。
Test
Seems you set a class rdoTest on the radiobutton, but in your jquery you query for a an id?
$('.rdoTest').hide();
下一步可能是你想做的:
var rdoTest =$('.rdoTest');rdoTest.hide();
符号 # 表示按 Id 选择,但您想按类名选择。