Category Archives: Selecting Decorating and Enhancing

Simple Selecting

jQuery(<selectors go here>)
Or the alias:
$(<selectors go here>)

Confused ..Ok

If we wanted to select every paragraph, divelement, h1heading, or input box on the page, we would use these selectors accordingly:


jQuery borrows the conventions from CSS for referring to id and class names. To select by id, use the hash symbol (#) followed by the element’s id, and pass this as a string to the jQuery function:

Similarly, we can use a CSS class selector to select by class. We pass a string consisting of a period (.) followed by the element’s class name to the jQuery function:

getting started

Before we can interact with HTML elements on a page, those elements need to have been loaded: we can only change them once they’re already there.

<script type=”text/javascript”>

$(document).ready(function() {
alert(‘welcome to the star to jquery…’);


$(function() {
 code goes here