1 each element has one or more attributes that are used to give additional information about the element or its contents, such as: In an IMG element, SRC is the attribute of the element, and the address that marks the image
2 main DOM methods for operating characteristics
GetAttribute method
SetAttribute method
RemoveAttribute method
3 jquery uses the attr () method to get and set element properties, attr is an abbreviation for attribute (attribute)
4 Expression of attr ()
attr (incoming property name) Gets the value of the property
Attr (property name, property value) sets the value of the property
Attr (property name, function value) sets the function value of the property
attr (attributes) sets multiple attribute values for the specified element, that is (attribute name one: "Attribute value one", property name Two: "Property value Two", ...). )
5 removeattr () removes a property from each element in the collection of matching elements
6 attr, removeattr are jquery in order to attribute operations encapsulation, directly on the jquery object call the method, it is easy to manipulate the property, do not need to deliberately understand the browser's property name of the different problems
7 There is a concept in the DOM, attribute and property translation are attributes, in the "JS Advanced Programming" in the translation of attributes and attributes,attribute is the DOM node's own properties
8 Get attribute need to use attr, get property need to use prop
jquery properties and Styles ——. att () and. Removeattr ()