I want to launch the new Hubspot App integration and style my Hubspot form in Webflow. However, webflow adds html tags for the GDPR control / checkbox text. Any idea how to remove this?
Hey @Matthias_Dietrich, This is retrieved from the original source - in my case it’s defined as link in hubspot. Just have a look at the screenshots I attached.
This is the code snippet. Just change it to your classname and the p-tags will be deleted on the published page:
// Get all labels with the class .form_checkbox
var checkboxLabels = document.querySelectorAll('.form_checkbox');
// Loop through each label
checkboxLabels.forEach(function (label) {
// Check if the label contains the <p> tags
if (label.innerHTML.includes('<p>') && label.innerHTML.includes('</p>')) {
// Remove the <p> tags and their contents
label.innerHTML = label.innerHTML.replace(/<p>|<\/p>/g, '');
}
});