Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You have selected a DOM element using the jQuery function and need to get or set the value of the DOM element’s attribute.
jQuery provides the attr() method for getting and setting attribute values. In the following code, we are going to be setting and then getting the value of an <a> element’s href attribute: