Activity Forums Salesforce® Discussions How can you access a value from an attribute?

  • MOHIT

    Member
    June 4, 2020 at 3:04 pm

    You can get as shown below
    component.get("v.falseValue")
    Complete code is here
    <aura:component>

    <aura:attribute name="falseValue" type="boolean" default="false" />

    <ui:button label="Log Value" press="{!c.logValue}"/>
    <aura:component>
    ({
    logValue : function(component, event, helper) {
    console.log(component.get("v.falseValue"));
    }
    })

  • Aditya

    Member
    June 4, 2020 at 3:17 pm

    Hi,
    The getAttribute() method returns the value of the attribute with the specified name, of an element. Tip: Use the getAttributeNode() method if you want to return the attribute as an Attr object.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos