Tutorial jQuery (Part 1)

jQuery Tutorial (Part 1)

  • Apa yang harus sebelumnya anda tahu

Sebelum melanjutkan lebih jauh tentang jQuery, anda seharusnya telah memiliki pengetahuan tentang :

  1. HTML
  2. CSS
  3. JavaScript
  • Apakah jQuery itu?

jQuery adalah suatu library untuk fungsi-fungsi dari javascript, jQuery memiliki fitur-fitur seperti :

  1. HTML element selection
  2. HTML element manipulation
  3. CSS manipulation
  4. HTML event manipulation
  5. JavaScript Effects and animation
  6. HTML DOM traversal and modification
  7. AJAX
  8. Utilities
  • Menambah Library jQuery ke halaman web

Library jQuery disimpan dalam satu file, yang berisi semua fungsi-funsi JavaScript, library tersebut dapat ditambah ke halaman web dengan cara seperti dibawah :

<head>
<script type="text/javascript" src="jquery.js"></script>
</head>

  • Contoh Sederhana jQuery

<html>

<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("p").hide();
});
});
</script>
</head>

<body>
<h2>Bagian Heading</h2>
<p>Bagian paragraph.</p>
<p>Paragraph lain.</p>
<button>Klik Disini !</button>
</body>
</html>

  • Mengunduh jQuery

Library jQuery dapat diunduh di sini atau sebagai alternatif anda dapat menggunakan library jQuery tanpa mengunduh, tetapi menggunakan jQuery yang disediakan oleh Google atau Microsoft :

Google :

<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
</head>


Microsoft :
<head>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
</head>

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.