개발일지/Web Development
jQuery 제이쿼리 기초
jungwonyu
2022. 1. 25. 13:58
728x90
jQuery 란?
- HTML의 요소들을 조작하는, 편리한 Javascript를 미리 작성해둔 것. (라이브러리)
- import 해서 사용(https://www.w3schools.com/jquery/jquery_get_started.asp)
jQuery VS Javascript
- Javascript
document.getElementById("element").style.display = "none";
- jQuery
$('#element').hide();
👉 Javascript로 길고 복잡하게 써야 하는 것을 jQuery로 직관적으로 쓸 수 있음
jQuery 사용법
1) 임포트
- https://www.w3schools.com/jquery/jquery_get_started.asp
(jQuery CDN 부분 참고)
jQuery Get Started
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
www.w3schools.com
2) <head> 와 </head> 사이에 jQuery CDN 붙여 넣기
3) id 값을 통해 가리키기(CSS에서 선택자로 class를 사용한 것과 동일)