Skip to content

Instantly share code, notes, and snippets.

@jvmccarthy
Created January 3, 2023 02:22
Show Gist options
  • Save jvmccarthy/0373ad6555cd52f7a48d344c12a9d3ce to your computer and use it in GitHub Desktop.
Save jvmccarthy/0373ad6555cd52f7a48d344c12a9d3ce to your computer and use it in GitHub Desktop.
Playing with JSBarcode
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/JsBarcode.all.min.js"></script>
<style>
* {
font-family: sans-serif;
}
</style>
</head>
<body>
<label>To barcode:
<input id="barcodeInput" type="text" />
</label>
<div>
<img id="barcode"/>
</div>
<script>
document.getElementById('barcodeInput').addEventListener('change', event => {
JsBarcode("#barcode", event.target.value);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment