getAttr,_.getAttr

Function Description
Takes two parameters. Returns the given element's attribute value by attribute name. Returns the given UPJSObject's attribute value by attribute name.
Function prototype
_.getAttr(element,attrName). Returns value of the @attrName of @element. Returns value of the @attrName of UPJSObject.
Function parameters
@element - dom element
@name - dom attribute name
Sample HTML DIV element is given to try UPJS function.
Orange DIV
Apple DIV
  • apple 1
  • apple 2
Code area to try out getAttr,_.getAttr function.