HTML and CSS Reference
In-Depth Information
I strongly recommend that you learn pure JavaScript before getting too involved in libraries like jQuery. That way
you have a better understanding of what JavaScript itself is responsible for and what the library is doing to help
you out.
jQuery Basics
Before you can use jQuery, you need to download the library and include it in your HTML file. Let's set up another
test file so that you can get familiar with jQuery. Follow these steps:
1. Download the latest version from the jQuery website ( http://jquery.com ) . At the time of writing this,
the latest version is 1.8.1
2. Place this file in your javascript-examples folder.
3. Create a new file in your text editor.
4. Save this file as example10-10.html .
5. Add the following code to this file:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery Test Page</title>
</head>
<body>
<header>
<h1>This is a test page</h1>
</header>
<section id="text">
<h1>A Text Section</h1>
<p id="firstParagraph" class="paragraph">
This text is within the first paragraph element.
</p>
<p class="paragraph">
This text is in the second p element.
</p>
</section>
<section id="form">
<h1>A Web Form</h1>
<form id="webForm" action="#" method="post">
<p>
<label for="name">Name</label>
<input type="text" id="name" name="name">
</p>
<p>
<label for="email">Email</label>
<input type="email" id="email" name="email">
</p>
<p>
<button type="submit">Submit</button>
</p>
Search WWH ::




Custom Search