jQuery logojQuery API Documentation

  • Home
  • API Documentation
  • CDN
  • Plugins
  • Browser Support

Categories: Attributes


These methods get and set DOM attributes of elements.
Attributes | Manipulation > Class Attribute | CSS

.addClass()

Adds the specified class(es) to each element in the set of matched elements.
Attributes | Manipulation > General Attributes

.attr()

Get the value of an attribute for the first element in the set of matched elements or set one or more attributes for every matched element.
Attributes | Manipulation > Class Attribute | CSS

.hasClass()

Determine whether any of the matched elements are assigned the given class.
Attributes | Manipulation > DOM Insertion, Inside

.html()

Get the HTML contents of the first element in the set of matched elements or set the HTML contents of every matched element.
Attributes | Manipulation > General Attributes

.prop()

Get the value of a property for the first element in the set of matched elements or set one or more properties for every matched element.
Attributes | Manipulation > General Attributes

.removeAttr()

Remove an attribute from each element in the set of matched elements.
Attributes | Manipulation > Class Attribute | CSS

.removeClass()

Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
Attributes | Manipulation > General Attributes

.removeProp()

Remove a property for the set of matched elements.
Attributes | Manipulation > Class Attribute | CSS

.toggleClass()

Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument.
Attributes | Forms | Manipulation > General Attributes

.val()

Get the current value of the first element in the set of matched elements or set the value of every matched element.
  • Ajax
    • Global Ajax Event Handlers
    • Helper Functions
    • Low-Level Interface
    • Shorthand Methods
  • Attributes
  • Callbacks Object
  • Core
  • CSS
  • Data
  • Deferred Object
  • Deprecated
    • Deprecated 1.3
    • Deprecated 1.4
    • Deprecated 1.7
    • Deprecated 1.8
    • Deprecated 1.9
    • Deprecated 1.10
    • Deprecated 3.0
    • Deprecated 3.3
  • Dimensions
  • Effects
    • Basics
    • Custom
    • Fading
    • Sliding
  • Events
    • Browser Events
    • Document Loading
    • Event Handler Attachment
    • Event Object
    • Form Events
    • Keyboard Events
    • Mouse Events
  • Forms
  • Internals
  • Manipulation
    • Class Attribute
    • Copying
    • DOM Insertion
    • DOM Insertion, Around
    • DOM Insertion, Inside
    • DOM Insertion, Outside
    • DOM Removal
    • DOM Replacement
    • General Attributes
    • Style Properties
  • Miscellaneous
    • Collection Manipulation
    • Data Storage
    • DOM Element Methods
    • Setup Methods
  • Offset
  • Properties
    • Properties of jQuery Object Instances
    • Properties of the Global jQuery Object
  • Removed
  • Selectors
    • Attribute
    • Basic
    • Basic Filter
    • Child Filter
    • Content Filter
    • Form
    • Hierarchy
    • jQuery Extensions
    • Visibility Filter
  • Traversing
    • Filtering
    • Miscellaneous Traversing
    • Tree Traversal
  • Uncategorized
  • Utilities
  • Version
    • Version 1.0
    • Version 1.0.4
    • Version 1.1
    • Version 1.1.2
    • Version 1.1.3
    • Version 1.1.4
    • Version 1.2
    • Version 1.2.3
    • Version 1.2.6
    • Version 1.3
    • Version 1.4
    • Version 1.4.1
    • Version 1.4.2
    • Version 1.4.3
    • Version 1.4.4
    • Version 1.5
    • Version 1.5.1
    • Version 1.6
    • Version 1.7
    • Version 1.8
    • Version 1.9
    • Version 1.12 & 2.2
    • Version 3.0
    • Version 3.1
    • All
  • Learning Center
  • Forum
  • API
  • Twitter
  • IRC
  • GitHub

Copyright 2018 The jQuery Foundation. jQuery License