hex_decimal converter

CDA4101

by Alan Harris

HTML

Insert Hex to convert: <br /><br />
<input type="text" id="hexValue" value="2F3A">
<button onclick="convtodec();">Convert</button>

<div id="output">

</div>

CSS

button {
    background-color: grey;
    border: 1px solid black;
    color: white;
    padding: 4px 8px;
    text-decoration: none;
    margin: 4px 2px;
    }
button:hover {
   background-color: black;
 }

button:focus {
  border: 1px solid black;
  padding: 4px 4px;
}

JavaScript

function convtodec() {
	var value = 0;
  
  var hexmap = {
  "1" : "1",
  "2" : "2",
  "3" : "3",
  "4" : "4",
  "5" : "5",
  "6" : "6",
  "7" : "7",
  "8" : "8",
  "9" : "9",
  "A" : "10",
  "B" : "11",
  "C" : "12",
  "D" : "13",
  "E" : "14",
  "F" : "15",
  };
}