diff index.html @ 9:5998f1f51877

Simplify selector
author nanaya <me@nanaya.pro>
date Sat, 28 Nov 2020 06:12:04 +0900
parents e50d930b2af1
children 09146b1bfb65
line wrap: on
line diff
--- a/index.html	Fri Jul 06 16:28:26 2018 +0900
+++ b/index.html	Sat Nov 28 06:12:04 2020 +0900
@@ -83,8 +83,8 @@
     <script src="qrcode.min.js"></script>
 
     <script>
-        var inputDom = document.getElementsByClassName("js-qr-input")[0]
-        var outputDom = document.getElementsByClassName("js-qr-output")[0]
+        var inputDom = document.querySelector(".js-qr-input")
+        var outputDom = document.querySelector(".js-qr-output")
         var qr = new QRCode(outputDom, { correctLevel: QRCode.CorrectLevel.L })
 
         var runTimeout = null