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
次にやりたいことがあるかもしれません:
var rdoTest =$('.rdoTest');rdoTest.hide();
記号 # は ID による選択を意味しますが、クラス名による選択が必要です。
ラジオボタンにクラス rdoTest を設定しているようですが、jquery で ID を照会しますか?
$('.rdoTest').hide();