I know this is an old question, but I think it is not necessary a library to generate a QR Code from a text. You just need to use the QR code API.
The implementation is very simple, we have a form with a text field that captures the content data. Whenever we press the generate button we generate a new request URL to the API this URL has two main components data and size. The former requires the text content encoded and the latter will define the size of the image. Here is the code:
let baseURL = 'https://api.qrserver.com/v1/create-qr-code/?data='
let config = '&size=120x120'
let btn, qrCode, content;
function htmlEncode(value) {
return $('').text(value).html();
}
$(function() {
btn = $('#generate');
qrCode = $('.qr-code');
content = $('#content');
btn.click(function() {
qrCode.attr('src', baseURL + encodeURIComponent(htmlEncode(content.val())) + config);
});
});
.qr-code {
max-width: 160px;
margin: 10px;
}