_.attr

Function Description
Attr has two or three input parameters.For two parameters, it returns elements with the given attribute that equals to value from document.body. For two parameters, it returns elements the given attribute that equals to value from third parameter.
Function prototype
_.attr(attribute,value, context). If @context defined, it returns elements with @attributes equal to @value from @context else document.body.
Function parameters
@attribute - dom attribute
@value - dom attribute value
@context - context that is applied, it is an html element
Sample HTML DIV element is given to try UPJS function.
Orange DIV
Apple DIV
  • apple 1
  • apple 2
Code area to try out _.attr function.