Hello, to anyone reading. I need some suggestions ASAP
I am trying to manipulate the html code of a HubSpot CTA by adding a custom HTML attr. I’ve used the .attr() and .setAttribute() methods respectively and called the css class of the HubSpot CTA. However, it did not affect the html element. Has anyone encountered this before?
Hey @db_509 - I would need more info to get you an accurate reply but my gut is telling me the jQuery is firing before the CTA button has arrived in the DOM. If you’re running the code inside a module scope, try running it outside of the module scope, perhaps in your main.js or at the end of the page before the closing </body> tag - and be sure to include the jQuery selector inside a document.ready to ensure the entire DOM (include the CTA button) has loaded.