Jump to content

clickable textbox

Recommended Posts

  • Replies 2
  • Views 147
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

You can use this code to Website Tools > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
$('section[data-section-id="67327a8bb0b27c5ce28e1805"] .fe-block').click(function(){
		window.location=$(this).find("p a").attr("href"); 
		return false;
	});
</script>
<style>
  section[data-section-id="67327a8bb0b27c5ce28e1805"] .fe-block {
  	cursor: pointer;
  }
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

  • 2 weeks later...
Posted

Add this code into pages > web tools > code injection > footer :

// Select all elements with the class 'fe-block' inside the specified section
document.querySelectorAll('section[data-section-id="67327a8bb0b27c5ce28e1805"] .fe-block').forEach(function (block) {
    block.style.cursor = 'pointer'; // Set the cursor to pointer

    // Add a click event listener to each block
    block.addEventListener('click', function () {
        const link = block.querySelector('p a'); // Find the anchor tag inside the block
        if (link && link.href) {
            window.location = link.href; // Navigate to the href of the anchor tag
        }
    });
});

Let me know if it works or not.

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.