Take a look at this HTML snippet:
<style>
.barcode { font-family: 'BC C39 3 to 1 Medium'; }
</style>
<div><span id='spn'>1234567</span></div>
This code will apply a barcode font style:
<script>
document.getElementById('spn').className = 'barcode';
</script>
However, the following code won't work:
<script>
document.getElementById('spn').style.fontFamily = 'BC C39 3 to 1 Medium';
</script>
Why is that?
I'm trying to use the style.fontFamily property instead of className, but it doesn't seem to be working for some reason.