<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="style.css"> <title>Document</title> </head> <body> <div class="container"> <div class="coupon-card"> <img src="google.png" alt="" class="logo"> <h3>20% Flat off on all ride with in the city using <br> HDFC Credit Card </h> <div class="coupon-row"> <span id="cpncode">STEALDEAL20</span> <span id="cpnbtn">Copy CODE</span> </div> <p>Valid Till:20-11-2022</p> <div class="circle1"></div> <div class="circle2"></div> </div> </div> <script> var cpnbtn = document.getElementById("cpnbtn") var cpncode = document.getElementById("cpncode") cpnbtn.onclick = function(){ navigator.clipboard.writeText(cpncode.innerHTML); cpnbtn.innerHTML = "COPIED"; setTimeout(function(){ cpnbtn.innerHTML = "COPY"; }, 3000); } </script> </body> </html>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter