Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Creating a Code 39 Barcode using HTML, CSS and Javascript

, 14 Jan 2011 GPL3
Creating a Code 39 Barcode using HTML, CSS and Javascript
htmlbarcode_src.zip
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Code39 Barcode</title>
    <script type="text/javascript" src="code39.js"></script>
    <style type="text/css">
  	#barcode {font-weight: normal; font-style: normal; line-height:normal; sans-serif; font-size: 12pt}
    </style>
</head>
<body>

Input : 123456<br />
Barcode : Code39<br />
Check Digit : 1 (On)<br /><br />

Output : <br /><br />

<div id="externalbox" style="width:5in">
<div id="inputdata" >123456</div>
</div>

<br />

<script type="text/javascript">
/* <![CDATA[ */
  function get_object(id) {
   var object = null;
   if (document.layers) {
    object = document.layers[id];
   } else if (document.all) {
    object = document.all[id];
   } else if (document.getElementById) {
    object = document.getElementById(id);
   }
   return object;
  }
get_object("inputdata").innerHTML=DrawCode39Barcode(get_object("inputdata").innerHTML,1);
/* ]]> */
</script>

</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

ConnectCode

Singapore Singapore
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150414.1 | Last Updated 14 Jan 2011
Article Copyright 2011 by ConnectCode
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid