Created
January 3, 2023 02:22
-
-
Save jvmccarthy/0373ad6555cd52f7a48d344c12a9d3ce to your computer and use it in GitHub Desktop.
Playing with JSBarcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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