Get a professional website for $99 per month. One week turnaround.

Copy Link Button (Elementor Tutorial)

Home Elementor 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!

More Free Resources