May 2017
Intermediate to advanced
448 pages
10h 10m
English
We may need to access or change several other attributes or properties from time to time. For manipulating attributes such as id, rel, and href, jQuery provides the .attr() and .removeAttr() methods. These methods make changing an attribute a simple matter. In addition, jQuery lets us modify more than one attribute at a time, similar to the way we worked with multiple CSS properties using the .css() method in Chapter 4, Styling and Animating.
For example, we can easily set the id, rel, and title attributes for links all at once. Let's start with some sample HTML:
<h1 id="f-title">Flatland: A Romance of Many Dimensions</h1> <div id="f-author">by Edwin A. Abbott</div> <h2>Part 1, Section 3</h2> <h3 id="f-subtitle"> Concerning ...
Read now
Unlock full access