QR Code Generator .html Widget Code

Modified on Sat, 22 Jul 2023 at 03:34 AM

This code is a QR Code Generator with options to download the .png or copy the code to your clipboard. It includes a reset field option below.


<!DOCTYPE html>
<html>
<head>
  <title>QR Code Generator</title>
  <style>
    body {
      font-family: Arial, sans-serif;
    }

    #qr-container {
      text-align: center;
      margin-top: 50px;
    }

    #link-input {
      width: 300px;
      padding: 10px;
    }

    #generate-button, #copy-button, #reset-link {
      padding: 10px;
      color: white;
      border: none;
      cursor: pointer;
      text-decoration: none;
    }

    #generate-button, #copy-button {
      background-color: black;
      margin-right: 10px;
    }

    #reset-link {
      color: red;
    }
  </style>
</head>
<body>
  <h1>QR Code Generator</h1>
  <div id="qr-container">
    <input type="text" id="link-input" placeholder="Enter link URL">
    <button id="generate-button" onclick="generateQR()">Generate QR Code</button>
    <button id="copy-button" onclick="copyQR()">Copy Image</button>
    <a id="download-link" style="display: none" download="qrcode.png">Download Image</a>
    <br>
    <a id="reset-link" onclick="resetForm()">Reset</a>
  </div>

  <script src="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js"></script>
  <script>
    // JavaScript functions go here (as in the previous example)
  </script>
</body>
</html>

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article