getAttribute method
Retrieves an attribute value by name.
getAttribute(name )
Parameters
String name
The name of the attribute to retrieve.
Returns
String. The Attr value as a string, or the empty string if that attribute does not have a specified or default value.
这对您有帮助吗?