title: Create a qrcode image then convert to base64
body: <p>I am using <a href="http://davidshimjs.github.io/qrcodejs/" rel="nofollow noreferrer">http://davidshimjs.github.io/qrcodejs/</a> to generate qr-code</p>
  
  <pre class="lang-js prettyprint-override"><code>          var qrcode = new QRCode(&quot;qrcode&quot;, {
              text: &quot;http://jindo.dev.naver.com/collie&quot;,
              width: 128,
              height: 128,
              colorDark: &quot;#000000&quot;,
              colorLight: &quot;#ffffff&quot;,
              correctLevel: QRCode.CorrectLevel.H
            });
            console.log(qrcode);
            console.log(qrcode._el.children[1].currentSrc);
  </code></pre>
  <p><a href="https://i.stack.imgur.com/fgm0k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fgm0k.png" alt="enter image description here" /></a></p>
  <p>I can find the base64 code in &quot;qrcode&quot;<br>
  But why I get empty when I run:</p>
  <pre><code>console.log(qrcode._el.children[1].currentSrc);
  </code></pre>
  <p><a href="https://i.stack.imgur.com/9R91W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9R91W.png" alt="enter image description here" /></a></p>
  <p>Is there any other method to get the base64 code?</p>