Get img src from the DOM for printing

I have now found a better way. With the NPM package ‘qr code generator’ (Tutorial: Create a QR code - #3 by raydeck ), I am not generating an image that is then inserted into a DIV via JavaScript code (document.getElementById(‘placeHolder’).innerHTML = qr.createImgTag();), but the package also allows outputting a Data URL, which I can easily output into a variable during page load and then bind to an IMG container. This works excellently.

1 Like