Here is a javascript code for generating QR code from website url. Please try it <!DOCTYPE html> <html> <head> <title>QR code generator</title> </head> <body> <div> <input type="text" id="urlInput" placeholder="Enter website URL"> <button id="generateButton">Generate QR code</button> </div> <script> function generateQRCode(url) { // create a new canvas element var canvas = document.createElement('canvas'); // set the canvas size canvas.width = 128; canvas.height = 128; // get the canvas context var ctx = canvas.getContext('2d'); // fill the canvas with white ctx.fillStyle = 'white'; ctx.fillRect(0, 0, canvas.width, canvas.height); // set the QR code color to black ctx.fi...
Comments
Post a Comment