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 | 29 |
30 | 31 |
Tags
- 설치
- Java
- css
- property
- jsp
- jQuery
- GUI
- springframework
- String
- 연락처 프로그램
- 윈도우 #단축키
- Event
- File 클래스
- Method
- 자바
- 데이터베이스
- 연산자
- 파일 입출력
- spring
- 코틀린#클래스#상속
- list
- javaservlet
- 다형성
- array
- 오라클
- function
- kotlin #return #jump
- 상속
- html
- JavaScript
Archives
- Today
- Total
Binary World
jQuery 기본 문법 본문
<jQuery의 기본문법>
- jQuery의 기본 문장 : $('selector').action();
- $('selector'): HTML 요소를 찾음. CSS 선택자(태그, 클래스, 아이디);
- action(): 해당 HTML 요소에 행해질 동작(기능)
<02_syntax.html>
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>jQuery</title> <script src="https://code.jquery.com/jquery-3.2.1.min.js"> </script> </head> <body> <h1>jQuery 기본 문법</h1> <button type="button" id="btn1">모두 숨기기</button> <button type="button" id="btn2">클래스 숨기기</button> <button type="button" id="btn3">아이디 숨기기</button> <p>단락 1</p> <p class="c1">단락 2, 클래스 c1</p> <p class="c1">단락 3, 클래스 c1</p> <p id="p1">단락 4, 아이디 p1</p> <script> // jQuery의 기본 문장 : $('selector').action(); // $('selector'): HTML 요소를 찾음. CSS 선택자(태그, 클래스, 아이디); // action(): 해당 HTML 요소에 행해질 동작(기능) $(document).ready(function(){ $('#btn1').click(function() { $('p').hide(); }); $('#btn2').click(function() { $('.c1').hide(); }); $('#btn3').click(function() { $('#p1').hide(); }); }); </script> </body> </html> | cs |
<출력화면>
'개발자의 길 > jQuery' 카테고리의 다른 글
jQuery CSS 변경 (0) | 2017.04.10 |
---|---|
jQuery getter/setter (0) | 2017.04.10 |
jQuery 이벤트(event) 02 (0) | 2017.04.10 |
jQuery 이벤트(event) 01 (0) | 2017.04.10 |
jQuery 사용하기 (0) | 2017.04.10 |
Comments