Layout Options

  • Fixed Header
    Makes the header top fixed, always visible!
  • Fixed Sidebar
    Makes the sidebar left fixed, always visible!
Introduction
Webconcept

CSS Manipulation

jQuery selectors allow selection and manipulation of HTML elements as a group or as a single element.

Element Selectors

jQuery uses CSS selectors to select HTML elements.

Selector / Description
*
Selects all elements


Example:
$("*")
element
Selects all elements with the given tag name


Example:
$("p")
.class
Selects all elements with the given class


Example:
$(".intro")
#id
Selects a single element with the given id attribute


Example:
$("#demo")

Attribute Selectors

jQuery uses XPath expressions to select elements with given attributes.

Selector / Description
[attribute]
Selects elements that have the specified attribute, with any value


Example:
$("[href]")
[attribute=value]
Selects elements that have the specified attribute with a value exactly equal to a certain value


Example:
$("[href='#']")
[attribute!=value]
Select elements that either don't have the specified attribute, or do have the specified attribute but not with a certain value


Example:
$("[href!='#']")
[attribute$=value]
Selects elements that have the specified attribute with a value ending exactly with a given string. The comparison is case sensitive


Example:
$("[href$='.jpg']")

CSS Selectors

jQuery CSS selectors can be used to change CSS properties for HTML elements.

he following example changes the background-color of all p elements to yellow:

$("p").css("background-color","yellow");