The HTML/JS element in ClickFunnels allows users to embed custom HTML and JavaScript code directly within a funnel page. This feature is designed for advanced users who want to add unique functionalities or styles that go beyond what standard ClickFunnels elements offer. In this article, you’ll learn how to properly add HTML and JavaScript code in the HTML/JS element to enhance your funnel pages.
Requirements
An active ClickFunnels account.
A page created in your workspace.
Important:
Advanced Feature: The Custom HTML/JS element is an advanced feature. Using custom code requires a good understanding of HTML and JavaScript, as improper code can break page functionality. Use with caution.
Support Limitations: ClickFunnels Support does not troubleshoot custom code issues. Custom code can be complex and time-consuming to debug. If you encounter issues, consult a qualified developer.
Adding an HTML/JS Element in the Page Editor
Inside the page editor, add a Section where you want to place the element.
Add a Row within that section.
Click the orange + Plus or Add New Element button inside the row to insert a new element.
From the MISC (Miscellaneous) category, select the HTML/JS element.
Once the HTML/JS element is added, you can open the settings sidebar, select Open Code Editor, and enter your HTML and JavaScript code directly within the editor.
Customizing HTML/JS Element
When you hover over an element, its border will be highlighted in orange. To access an element's settings, click on the gear ⚙️ icon or click directly on the element to open its' settings panel.
Top Margin
The Top Margin setting allows you to control the space between the current element and the element directly above it. If no previous element exists, the margin will be applied relative to the parent container, such as a row, section, or flex container. You can adjust the margin using the slider or manually input a value (px or percentage %), ensuring the spacing is consistent with your design needs.
Open Code Editor
Clicking on Open Code Editor opens a text editor for adding custom HTML and JavaScript code. This editor supports both HTML and JavaScript code. Refer to the Adding HTML Code and Adding JavaScript Code sections below to learn more about properly adding HTML and JavaScript code.
Element Control Panel
The Element Control Panel appears at the bottom of every element in the page editor, offering quick access to essential settings and actions for that element. Here’s what each icon represents:
ALL: The element will be visible on all devices (desktop, tablet, and mobile).
Desktop Icon: The element will only be visible on the desktop view.
Mobile Icon: The element will only be visible on mobile view.
Eye Icon: Use this to hide the element from the page. The element will still be present in the editor but invisible to visitors.
Code Icon: This icon opens the code editor, where you can insert custom CSS or JavaScript code to modify the element's behavior or styling.
Trash Icon: Removes the element from the page editor entirely.
Advanced Settings
To further customize your container (section, row, column, and element), ClickFunnels provides powerful Advanced settings options that allow you to control style, advanced CSS, animation, and rendering logic. We’ve separated these advanced features into dedicated articles to avoid overwhelming you with too much content in one place and to keep our documentation concise. Explore the following resources for more details:
Advanced Settings - Customize Styles: Learn how to populate contents dynamically, position containers, and apply z-index.
Advanced Settings - Customize Animation: Learn how to add animations, control entry and exit effects, and adjust animation delay.
Advanced Settings - Customize Logic: Learn how to apply conditional logic to elements and add custom attributes.
Adding HTML Code
To add HTML code within the Custom HTML/JS element:
Open the Code Editor by clicking on Open Code Editor in the settings.
Enter your HTML code directly into the editor.
Caution:
Do not include
<html>
or<body>
tags. The Custom HTML/JS element is already placed within the page's<body>
section. Adding these tags could cause errors or conflicts with the page structure.
Adding JavaScript Code
The Custom HTML/JS element also supports JavaScript, allowing for interactive functionality or dynamic behavior.
To add JavaScript code:
Open the Code Editor by clicking on Open Code Editor in the settings.
Add your JavaScript code, enclosed in
<script> </script>
tags.
Note:
jQuery is available for use within ClickFunnels pages, so you can add jQuery syntax directly within the Custom HTML/JS element without needing to import it from CDN separately.
Troubleshooting Custom Code
If your code isn’t working as expected:
Check Console for Errors: Open your browser's developer tools and review the console for error messages.
Review Code Structure: Ensure your HTML and JavaScript syntax is correct and doesn’t conflict with existing elements.
Consult a Developer: Consider consulting a professional developer for assistance with complex functionality.