The property of the tag is called the element attribute, and the corresponding property of the DOM object in JS is called the DOM attribute. The DOM attribute name in JS is sometimes different from the original element property name.
================================== Action Element Properties ==================================
Returns an element that specifies a property value
var txt1_val=$ ("#txt1"). attr ("value");
Changing DOM property values through the DOM property name of an element
$ ("#txt1"). attr ({value: "Txt1_value", ClassName: "Txt1_class"});
changing element property values by specifying element properties
$ ("#txt1"). attr ("Class", "Txt1_class2");
Assigns a value to the specified element property, returning the value by the method that is bundled later
$ ("#txt1"). attr ("Class", function () {
return "TXT1_CLASS3";
})
Removes the specified element property
$ ("#txt1"). Removeattr ("class");
jquery gets and changes element attribute values