Skip to content

HTML Attributes Reference

Complete reference for HTML attributes used to build consent banners, preferences modals, and UI elements in Consent Pro V2.

Table of Contents

Attribute Overview

Consent Pro V2 uses HTML attributes to identify and bind functionality to DOM elements. All attributes follow the fs-consent-* naming pattern.

Primary Attributes

AttributePurpose
fs-consent-instanceIdentifies a consent instance
fs-consent-elementDefines element type/function
fs-consent-trackerIdentifies tracker category sections
fs-consent-templateMarks template elements
fs-consent-fieldIdentifies dynamic content fields
fs-consent-hideMarks conditionally hidden elements
fs-consent-styledcategoriesEnables styled categories display

Core Attributes

Identifies a specific consent instance. Required on the root container.

Values: Instance identifier string (e.g., "eu-banner", "us-banner", "global")

Defines the type and function of an element. Most important attribute for UI binding.

ValueDescription
"banner"Main consent notice
"preferences"Detailed preferences modal
"form"Preferences form container
"allow"Accept all cookies
"deny"Reject optional cookies
"fixed-preferences"Fixed preferences trigger (e.g., footer)
"open-preferences"Open preferences modal
"close"Close current UI
"donotsell"CCPA Do Not Sell button
"checkbox-analytics"Analytics consent toggle
"checkbox-marketing"Marketing consent toggle
"checkbox-personalization"Personalization consent toggle
"checkbox-donotsell"Do Not Sell toggle
"tracker-toggle"Toggle tracker details
"cookie-toggle"Toggle cookie details
"tracker-toggle-text"Text content for tracker toggle button
"placeholder"Blocked iframe placeholder
"internal-*"Internal elements (solution-specific)

Enables styled categories display mode.

Values: "true" or "false" (boolean)

Usage: When set to "true", enables enhanced styling for category sections in the preferences interface.

Action Elements

Allow Button

Accepts all cookie categories.

Deny Button

Rejects all optional cookies (keeps essential only).

Open Preferences Button

Opens the preferences modal.

Note: open-preferences can be placed anywhere, inside or outside the consent instance.

Close Button

Closes the current UI (banner or preferences).

Do Not Sell Button (CCPA)

Only available in opt-out and informational modes.

Form Elements

Checkbox Elements

Analytics Checkbox

Toggles consent for analytics cookies.

Marketing Checkbox

Toggles consent for marketing cookies.

Personalization Checkbox

Toggles consent for personalization cookies.

Do Not Sell Checkbox

Toggles CCPA "Do Not Sell" preference.

Form Submission

The form automatically handles submission when user clicks "Save Preferences".

Tracker Elements

Display detected trackers and cookies to users.

Identifies tracker category sections.

Values: Category name ("analytics", "marketing", "personalization", "essential")

Tracker Toggle Button

Toggles visibility of tracker details within a category section.

Toggles visibility of individual cookie/tracker details.

Template Elements

Templates for dynamic content rendering.

Marks template elements that will be cloned for rendering.

Values:

  • "trackers" - Root template container
  • "tracker-section" - Category section template
  • "tracker-item" - Individual tracker template
  • "cookie-item" - Individual cookie template
  • "tracker-details" - Tracker details template
  • "empty-state" - No trackers found template
  • "placeholder" - Blocked iframe placeholder

Styling Elements

Identifies dynamic content fields within templates.

Values: Field name ("name", "purpose", "domain", "title", "content", "message", etc.)

Marks elements that should be hidden if field value is empty.

Values: Field name to check

Internal Elements

Elements with fs-consent-element values prefixed with internal- (e.g., internal-component, internal-banner-text, internal-buttons-wrapper) are used internally by the Consent Pro solution for component structure and layout.

Best Practices

Multiple Triggers

  • You can place multiple open-preferences buttons throughout your site and it can be used to toggle Preferences to show
  • Consider adding preference triggers in navigation, footer, and banner areas

Next Steps