Open SCOMAC1959 opened 6 years ago
This is what I use to dynamically generate sheets of different barcodes.
Each item is added with an HTML template with the following. I replace the #UPC# with the actual value when generating the file.
<svg class="barcode"
jsbarcode-format="upc"
jsbarcode-value="#UPC#"
jsbarcode-textmargin="0"
jsbarcode-fontoptions="bold">
</svg>
Then at the end of the file I added this simple script line which initializes all .barcode classes.
<script>
JsBarcode(".barcode").init();
</script>
Is it possible to replace the barcode information with information from another div?
Something like: JsBarcode("#barcode3", "SK000007", { format: "CODE39", displayValue: true, });
Replacing the SK000007 with content of another div such as this jQuery code?: $('#div2').html($('#div1').html());
If so how might that be done?