jQuery Attributes Methods

About This Index
This page is the jQuery Attributes index for the tutorial track. Each row links to a full guide with syntax, examples, and FAQs.
Learn the jQuery overview on /jquery. Use this page when you need an Attributes API such as .attr(), .prop(), or .val().
Start with .attr(), then .prop() and .val()—use .removeAttr() when you need to strip markup attributes.
How to Call an Attributes Method
Getters read the first match; setters update every matched element:
$("a").attr("href"); // get
$("a").attr("href", "/docs"); // set
$("img").attr({ alt: "Logo", title: "Home" });
$("input").prop("checked", true); // live property
$("input").prop("disabled"); // boolean
$("input[name=q]").val(); // get form value
$("select").val(["a", "c"]); // multi-select
$("div").removeAttr("title");
$("div").removeProp("myCustomFlag"); jQuery Attributes Methods Table
All Attributes method guides in this jQuery tutorial series (5 tutorials).
Get & Set
3 methodsRead and write HTML attributes with .attr(), live DOM properties with .prop(), and form values with .val().
| Method | Description | Tutorial |
|---|---|---|
.attr() | Get or set HTML attributes — href, src, title, alt, id; use .prop() for checked, selected, and disabled. | Try it |
.prop() | Get or set live DOM properties — checked, disabled, selectedIndex; use .val() for form field values. | Try it |
.val() | Get or set form values on input, textarea, and select — multi-select returns an array. | Try it |
Remove
2 methodsStrip markup attributes and custom properties — .removeAttr() for HTML, .removeProp() for .prop() cleanup.
| Method | Description | Tutorial |
|---|---|---|
.removeAttr() | Remove one or more HTML attributes from every matched element (space-separated names since 1.7). | Try it |
.removeProp() | Remove a property previously set with .prop() — not for native checked/disabled; prefer .prop(name, false). | Try it |
Frequently Asked Questions
Start with .attr()
Open the attributes guide—syntax, examples, and FAQs.
16 people found this page helpful
