Copy Link Button (Elementor Tutorial)

June 1, 2023

In this Elementor tutorial I will show you how to create a “Copy Link” button to your website.

Timestamps:

  • 0:00 Introduction
  • 0:17 Elementor Tutorial Begins
  • 2:14 Fix Page Jumping

JavaScript Code:

				
					<script>
const copyBtn = document.getElementById('copyURL');

copyBtn.addEventListener('click', () => {
  const url = window.location.href;
  navigator.clipboard.writeText(url).then(() => {
    alert('URL copied successfully!');
  }).catch(() => {
    alert('Error copying URL to clipboard');
  });
});
</script>
				
			

CSS Code:

				
					selector:hover {
  cursor: pointer;
}
				
			

*Some of the links on this page are affiliate links, meaning we may receive a commission if you follow them. This allows us to continue providing free content and educational resources for you. Thank you for supporting our small business!

Share this post:

Facebook
Reddit
Twitter
Pinterest
LinkedIn
Email

More Free Resources

Join Our Community

Wicky Design YouTube

Get our latest videos by subscribing for FREE to our YouTube channel. New videos are uploaded weekly!