[show/hide]

$("#authPart0").click(function(){

        $("#oneChance").show();

        $("#oneDay").show();

        $("input:radio[name='surveyDbltype'][value='0']").prop("checked", true);

});


$("#authPart1").click(function(){

        $("#oneChance").hide();

        $("#oneDay").hide();

        $("input:radio[name='surveyDbltype'][value='2']").prop("checked", true);

});



[Html]

<tr>

<th><span style="color: red">* </span>참여권한</th>

<td>

<label><input type="radio" id="authPart0" name="authPart" value="0" checked="checked" style="width: 30px">회원</label> 

<label><input type="radio" id="authPart1" name="authPart" value="1" style="width: 30px">비회원</label>

</td>

</tr>

<tr>

<th><span style="color: red">* </span>참여형태</th>

<td>

<label id="oneChance"><input type="radio" id="survey0" name="surveyDbltype" value="0" checked="checked" style="width: 30px">1회</label> 

<label id="oneDay"><input type="radio" id="survey1" name="surveyDbltype" value="1" style="width: 30px">일별</label> 

<label id="multiChance"><input type="radio" id="survey2" name="surveyDbltype" value="2" style="width: 30px">중복</label>

</td>

</tr>




'개발Story > JQuery' 카테고리의 다른 글

selectbox 옵션 다루기  (0) 2017.06.30
[JQuery]클릭이벤트 주기  (0) 2016.12.02
[checkbox] Check옵션 다루기  (0) 2016.06.28
[radio] disable속성 다루기  (0) 2016.06.28
블로그 이미지

galaxyvom

◆개발자 놀이터 아직 초보라 글에 실수가 있을 수 있습니다 ;-)

,