User:Bokareis/Gothicnumberconverter.js

function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) return false;

return true; }

var inputtext = document.createElement("INPUT"); inputtext.setAttribute("type", "text"); inputtext.id = "text"; inputtext.maxlength = 4; inputtext.onkeypress = "return isNumberKey(event)" var submit = document.createElement("submit"); submit.setAttribute("type", "submit"); submit.value = "Convert"; submit.onclick = "Convertnumber";

var div = document.createElement("div"); div.id = "1";

body.appendChild(inputtext); body.appendChild(submit); body.appendChild(div);

var number;

function Convertnumber {

var textid = document.getElementById("text"); var textidvalue = textid.value;

if ( Number(textidvalue) === Number.NaN) { document.getElementById('1').innerHTML = "You didn't type a number"; } else {

var length = textidvalue.length;

if (length == 1 ) {

var onenumber = []; onenumber[0] = "0"; onenumber[1] = "•𐌰•"; onenumber[2] = "•𐌱•"; onenumber[3] = "•𐌲•"; onenumber[4] = "•𐌳•"; onenumber[5] = "•𐌴•"; onenumber[6] = "•𐌵•"; onenumber[7] = "•𐌶•"; onenumber[8] = "•𐌷•"; onenumber[9] = "•𐌸•";

var show = onenumber[textid.value];

document.getElementById('1').innerHTML = show; } else if (length == 2 ){

var textida = textid.value; var firstnumber = ["", "𐌹", "𐌺", "𐌻", "𐌼", "𐌽", "𐌾", "𐌿", "𐍀", "𐍁"]; var secondnumber = ["", "𐌰", "𐌱", "𐌲", "𐌳", "𐌴", "𐌵", "𐌶", "𐌷", "𐌸"];

var first = textida.charAt(0); var second = textida.charAt(1);

document.getElementById('1').innerHTML = "•" + firstnumber[first] + secondnumber[second] + "•"; } else if (length == 3 ){

var textida = textid.value; var firstnumber = ["", "𐍂", "𐍃", "𐍄", "𐍅", "𐍆", "𐍇", "𐍈", "𐍉", "𐍊"]; var secondnumber = ["", "𐌹", "𐌺", "𐌻", "𐌼", "𐌽", "𐌾", "𐌿", "𐍀", "𐍁"]; var thirdnumber = ["", "𐌰", "𐌱", "𐌲", "𐌳", "𐌴", "𐌵", "𐌶", "𐌷", "𐌸"];

var first = textida.charAt(0); var second = textida.charAt(1); var third = textida.charAt(2);

document.getElementById('1').innerHTML = "•" + firstnumber[first] + secondnumber[second] + thirdnumber[third] + "•"; } else if (length == 4 ){

var textida = textid.value; var firstnumber = ["", "𐌰", "𐌱", "𐌲", "𐌳", "𐌴", "𐌵", "𐌶", "𐌷", "𐌸"]; var secondnumber = ["", "𐍂", "𐍃", "𐍄", "𐍅", "𐍆", "𐍇", "𐍈", "𐍉", "𐍊"]; var thirdnumber = ["", "𐌹", "𐌺", "𐌻", "𐌼", "𐌽", "𐌾", "𐌿", "𐍀", "𐍁"]; var fourthnumber = ["", "𐌰", "𐌱", "𐌲", "𐌳", "𐌴", "𐌵", "𐌶", "𐌷", "𐌸"];

var fifthsymbol = "´";

var first = textida.charAt(0); var second = textida.charAt(1); var third = textida.charAt(2); var fourth = textida.charAt(3);

document.getElementById('1').innerHTML = "•" + firstnumber[first] + secondnumber[second] + thirdnumber[third] + fourthnumber[fourth] + fifthsymbol + "•"; } else { document.getElementById('1').innerHTML = "None"; } } }