Using JS to modify the HTML class attribute value, summed up under:
First, get the class attribute value
var value = $ ("div"). attr ("class")//Here Gets the class attribute value
var array=val.split ("");//separate the class value by a space, and get each value through the array
var value = document.getElementById ("div"). ClassName;
Change the value of class attribute
document.getElementById ("tr"). ClassName = "Styleclass";//styleclass for the new property value
document.getElementById ("tr"). SetAttribute ("Class", "Styleclass");
Third, add a class attribute (on the original basis)
var obj = document.getElementById (' A1 ');
Obj.classname + = ' styleclass '; Note that the preceding space prevents two properties from being combined
Four, remove a class attribute
$ ("tr"). Removeclass ("Styleclass");
Other:
1. Determine if there are attributes in the class attribute:
if (Value.indexof ("Styleclass") >= 0) {}
2. Change the border of select through CSS
<span style= "border:1px solid #7FFF00; Position:absolute; Overflow:hidden ">
<select style=" margin:-1px ">
<option>aaa</option>
<option >bbb</option>
</select>
</span>