From 37682b8f3003278af02fe67d4285b494ca069e83 Mon Sep 17 00:00:00 2001 From: csornmo <44673024+csornmo@users.noreply.github.com> Date: Fri, 1 Oct 2021 09:30:40 +0200 Subject: [PATCH 1/2] adding options for image alt-attribute var qrcode = new QRCode("qrcode", { alt: "image alt text", }); --- qrcode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qrcode.js b/qrcode.js index 5507c15..d3805b0 100644 --- a/qrcode.js +++ b/qrcode.js @@ -362,7 +362,7 @@ var QRCode; this._oContext = this._elCanvas.getContext("2d"); this._bIsPainted = false; this._elImage = document.createElement("img"); - this._elImage.alt = "Scan me!"; + this._elImage.alt = htOption.alt; this._elImage.style.display = "none"; this._el.appendChild(this._elImage); this._bSupportDataURI = null; From c60010e1b2b40779e5a99022f63e0ddc46bb5985 Mon Sep 17 00:00:00 2001 From: csornmo <44673024+csornmo@users.noreply.github.com> Date: Fri, 1 Oct 2021 09:32:08 +0200 Subject: [PATCH 2/2] Update README.md Adding options alt-attribute for image --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e2d2dc..a9e31d0 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,8 @@ var qrcode = new QRCode(document.getElementById("qrcode"), { height: 128, colorDark : "#000000", colorLight : "#ffffff", - correctLevel : QRCode.CorrectLevel.H + correctLevel : QRCode.CorrectLevel.H, + alt: "image alt text" }); ```