Activity Forums Salesforce® Discussions What is an attribute tag? What is the syntax for including them?

  • shariq

    Member
    September 22, 2018 at 10:50 am

    An attribute tag is a definition of an attribute of a custom component and it can only be a child of a component tag.

    Note that you cannot define attributes with names like id or rendered. These attributes are automatically created for all custom component definitions. The below piece of code shows the syntax for including them:

    <apex:component>
    <apex:attribute name="myValue" description="This is the value for the component." type="String" required="true"/>
    <apex:attribute name="borderColor" description="This is color for the border." type="String" required="true"/>

    <h1 style="border:{!borderColor}">
    <apex:outputText value="{!myValue}"/>
    </h1>

    </apex:component>

  • Parul

    Member
    September 22, 2018 at 1:02 pm

    HTML attribute is a modifier of an HTML element type. An attribute either modifies the default functionality of an element type or provides functionality to certain element types unable to function correctly without them. In HTML syntax, an attribute is added to an HTML start tag.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos