jQuery
jQuery는 DOM을 내부에 감추고 보다 쉽게 웹페이지를 조작할 수 있도록 돕는 도구
라이브러리
jQuery의 사용
<!DOCTYPE html>
<html>
<body>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<!-- jQuery( document ).ready(function( $ ) {}로 감싸는 것이 이상적 -->
<script>
jQuery( document ).ready(function( $ ) {
$('body').prepend('<h1>Hello world</h1>');
});
</script>
<!-- 코드 요약 예제 -->
<script>
$('body').prepend('<h1>Hello world</h1>');
</script>
</body>
</html>jQuery의 기본문법
Last updated