evoShop.ELEMENT.attr( attr [, value] )

arguments:

  • attr: string to identify to the attribute of the element to get/set
  • value (optional): value to set the attribute of the element
  • returns:

  • If a value is specified, the ELEMENT returns itself
  • If no value is provided, the attribute value of the ELEMENT is returned
  • <img id="my-img" href="picture.png" alt="My Picture">
    
    var img_alt = evoShop.$("#my-img").attr( "alt" ); //returns "My Picture"
    evoShop.$("#my-img").attr( "title" , "Picture" );
    
    <img id="my-img" href="picture.png" alt="My Picture" title="Picture">