Generate QR Code using Javascript or JQuery

QR Code - Quick Response code is type of matrix code. QR Codes are machine-readable and the content inside them cannot be changed once generated.

The main difference between barcodes and QR codes is one of physical dimensions. Barcodes can be scanned in a line. QR codes, on the other hand, add another dimension from which information can be written and scanned. Instead of a single line, these labels can be read both vertically and horizontally

In this article we will see how we can generate the QR Code in our web application using JS library.

To generate the QR Code in our Web Application first we need to import the JS library. JS library is available on Web for use. Also you can download the same from link  download.

Once  the JS is downloaded copied the JS file in your web application and import the same in your web-page using script tag.

Now we will write the add the JS function which will take any input and covert the same into QR Code

Steps to integrate code

  1. Download the JS and Copy in your JS folder
  2. import the JS in your HTML page
  3. Add the div container in your HTML to display the QR Code
  4. Add getQR function, set height & width as per your requirement.
  5. Working code available on JS Fiddle.