Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- input
- Append
- createtextnode
- htmlFor
- VAR
- appendChild
- boolean
- Let
- FOR
- 학습법 #집중력
- createElement
- Openlayers
- const
Archives
- Today
- Total
Atomic Habits
JQuery - n번 째 제외 :not(:nth-child(n)) / 특정 요소 포함하는 has() 본문
https://zxchsr.tistory.com/107
https://focus-on-my.tistory.com/57
[jQuery] DOM 요소 필터링 - 필터선택자
:button, :checkbox, :password . . . -> 이런식으로 요소별로 있음. 잘 안씀 - 위치기반 필터 선택자 설명 :first 첫 번째 요소 선택 :last 마지막 요소 선택 :first-child 첫 번째 자식 요소 선택 :last-child..
focus-on-my.tistory.com
[JQuery] table tr onclick event 특정 td만 제외 / <tr> onclick 이벤트 특정 <td> 제외
■ JQuery table tr onclick event 특정 td만 제외 / onclick 이벤트 특정 제외 ■ 예제 테이블 아이디 비밀번호 test 1234 ■ 사용법 # 예제 1 (첫번째 td를 제외한 나머지 td 클릭 시 콘솔 1이 찍힘) - 'tr td:n..
zxchsr.tistory.com
■ JQuery table tr onclick event 특정 td만 제외 / <tr> onclick 이벤트 특정 <td> 제외
■ 예제 테이블
<table id="testTable">
<thead>
<tr>
<th></th>
<th>아이디</th>
<th>비밀번호</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>test</td>
<td>1234</td>
</tr>
</tbody>
</table>
■ 사용법
# 예제 1 (첫번째 td를 제외한 나머지 td 클릭 시 콘솔 1이 찍힘) - 'tr td:not(:first-child)'
- 2(n)번째 td를 제외하고 싶을 경우 - 'tr td:not(:nth-child(2))'
- 마지막 td를 제외하고 싶을 경우 - 'tr td:not(:last-child)'
<script type="text/javascript">
$(document).ready(function() {
$('#testTable tbody').on('click', 'tr td:not(:first-child)', function () {
console.log('1');
});
});
'IT > JavaScript-JQuery' 카테고리의 다른 글
# input 태그에 한글 입력을 막는 방법 (0) | 2022.07.20 |
---|---|
[ES6] const {} = ... , const [] = ... 할당 (0) | 2022.07.20 |
DataTable - td 간격 조정 테스트(코드) (0) | 2022.07.14 |
숫자 형식 d3-format (toFixed()) (0) | 2022.07.12 |
ES6의 map, filter, reduce 의 Simple Example Code (0) | 2022.07.11 |
Comments