Activity › Forums › Salesforce® Discussions › What is an attribute tag? What is the syntax for including them?
Tagged: Apex Component, Attributes in Salesforce, HTML, HTML Tag, Salesforce Developer, Salesforce Syntax, Salesforce Visualforce
-
What is an attribute tag? What is the syntax for including them?
Posted by Aman on September 22, 2018 at 10:49 AMWhat is an attribute tag? What is the syntax for including them?
Parul replied 7 years, 7 months ago 3 Members · 2 Replies -
2 Replies
-
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>
- [adinserter block='9']
-
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.