728x90
SMALL
#jQuery
Link with HTML document
Use a CDN
Add the following code to your HTML document.
<script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
3.3.1 is the version. If you want to use a different version, change the number.
Download and connect
Click here to download jQuery. Some files are compressed and some are uncompressed. Then add the following code to your HTML document.
<script src="path/jquery-3.3.1.min.js"></script>
Change the path and file name appropriately.
use jQuery
The following is an example of changing the color of the h1 element with ID jb to red.
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>jQuery</title>
</head>
<body>
<h1 id="jb">Lorem Ipsum Dolor</h1>
<script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<script>
$( '#jb' ).css( 'color', 'red' );
</script>
</body>
</html>
If you want the jQuery code to be on top, do the following:
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>jQuery</title>
<script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<script>
$( document ).ready( function() {
$( '#jb' ).css( 'color', 'red' );
} );
</script>
</head>
<body>
<h1 id="jb">Lorem Ipsum Dolor</h1>
</body>
</html>
728x90
LIST