radio 체크하면 tr이 보이지 않도록...

radio 체크하면 tr이 보이지 않도록...

QA

radio 체크하면 tr이 보이지 않도록...

답변 2

본문

radio 체크하면 div나 td가 보이지 않도록 하는 방법이 알고 싶어요. 

 

<input type="radio" value="check" id="sense" name="sense">

 

이걸 체크하면 

 

특정 게시판 필드 tr이 안보이게 하고 싶습니다 ㅜㅜ 여러곳에 응용이 가능할 것 같은데 보고 배낄 사이트도 없고해서 여기 물어보게됐습니다. 바로 채택할게요 고수님들 꼭 답변해주세요 ...

 

 

이 질문에 댓글 쓰기 :

답변 2

예전에 비숫한 거 짠 적이 있는데...

한번 참고해보세요~

 

http://jsbin.com/nafato/1/edit?html,js,output 

 

[html]


<input type="radio" value="hide" id="sense1" name="sense"><label for="sense1">숨기기</label>
<input type="radio" value="show" id="sense2" name="sense"><label for="sense2">보이기</label>
<table border="1">
  <tr>
    <td>11111</td>
    <td>22222</td>
  </tr>
  <tr class="red">
    <td>33333</td>
    <td>44444</td>
  </tr>
  <tr class="red">
    <td>55555</td>
    <td>66666</td>
  </tr>
  <tr>
    <td>77777</td>
    <td>88888</td>
  </tr>
  <tr>
    <td>99999</td>
    <td>00000</td>
  </tr>
</table> 

 

[js]


$('input[name="sense"]').change(function(){
  if($('input[name="sense"]:checked').val() === "hide"){
    $('.red').hide();
  } else {
    $('.red').show();
  }
}); 
 

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 129,110
© SIRSOFT
현재 페이지 제일 처음으로