Layout Options

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

Description

The .prop() method sets or returns property values of selected elements.


Return Property Value

Get the value of a property for the first element in the set of matched elements.


v1.6

This method has the form:

.prop(propertyName )
Parameter Description
propertyName Specifies the name of the property to get

Return Value

This form returns a String object.


Set Property/Value

Set one or more properties for the set of matched elements.

v1.6

This method has the alternate form:

.prop(propertyName,value)
Parameter Description
propertyName Specifies the name of the property
value Specifies the value to set for the property

Return Value

This form returns a jQuery object.


Set Multiple Attribute/Value Pairs

Set one or more properties for the set of matched elements.

v1.6

This method has the alternate form:

.prop(map)
Parameter Description
map Specifies a map of property-value pairs to set

Return Value

This form returns a jQuery object.


Set Attribute/Value Using a Function

Using a function to set one or more properties for the set of matched elements.

v1.6

This method has the alternate form:

.prop(propertyName,function(index,oldPropertyValue))
Parameter Description
propertyName Specifies the name of the property
function(index,
oldPropertyValue)
Specifies a function that returns the property value to set.
  • index - Receives the index position of the selector
  • oldvalue - Receives the current property value of the selector

Return Value

This form returns a jQuery object.


Examples

Set the width attribute of an image:

$("button").click(function(){
  $("img").prop("width","150");
});

Description

The .removeProp() method removes a property for the set of matched elements.


v1.6

This method has the form:

.removeProp(propertyName )
Parameter Description
propertyName (required) Specifies the name of the property

Return Value

This form returns a jQuery object.