Guest Posted January 26, 2021 Share Posted January 26, 2021 I'm trying to hide a default Squarespace form caption type when typing with Javascript yet it doesn't seem to work. This must be an issue you must have run into previously. Would really appreciate your help! Here's my Js bit embeded in the code const captionBox = document.querySelector(".caption") captionBox.addEventListener("click", hideCaption); function hideCaption () { const fields = document.querySelectorAll(".field-element") const captionText = document.querySelector(".caption-text") fields.forEach(field => { if (field.classList.contains("focus-visible")) { captionText.style.visibility = "hidden"; } else { captionText.style.visibility = "visible"; } }) } Link to comment
tuanphan Posted February 2, 2021 Share Posted February 2, 2021 Have you wrap code in script tag yet? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment