체크박스를 선택하면 해당 테이블셀(TR) 색상을 변경 > jquery

본문 바로가기
사이트 내 전체검색

jquery

체크박스를 선택하면 해당 테이블셀(TR) 색상을 변경

페이지 정보

작성자 서방님 댓글 0건 조회 409회 작성일 15-11-20 17:31

본문

출처 : http://blueb.co.kr/?m=bluebdata&bid=js_forms&uid=2031&c=1/9


<html>

<head>

<title>http://www.blueb.co.kr</title>

<script>

function check(it) {

  tr = it.parentNode.parentNode;

  tr.style.backgroundColor = (it.checked) ? "gold" : "white";

}

</script>

</head>

<body>


<form onsubmit="return false">

<table class="test" border=1 width=400>

<tr><td width=20><input type="checkbox" onclick="check(this)"></td><td>blub-B</td><td>blub-B</td></tr>

<tr><td><input type="checkbox" onclick="check(this)"></td><td>blub-B</td><td>blub-B</td></tr>

<tr><td><input type="checkbox" onclick="check(this)"></td><td>blub-B</td><td>blub-B</td></tr>

<tr><td><input type="checkbox" onclick="check(this)"></td><td>blub-B</td><td>blub-B</td></tr>

</table>

</form>


</body>

</html>

댓글목록

등록된 댓글이 없습니다.

회원로그인

접속자집계

오늘
77
어제
84
최대
1,347
전체
154,448
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.