»
EnglishFrenchVietnamese

Print - Binary 101 - JavaScriptBank.com

Full version: jsB@nk » Utility » Converter » Binary 101
URL: https://www.javascriptbank.com/binary-101.html

Binary 101 © JavaScriptBank.comThis program makes it easy to type in binary. You enter the text in the box designated and each key press is translated to binary and added to a box below. The result in the bottom box can then be copied and pasted and used for... whatever...

Full version: jsB@nk » Utility » Converter » Binary 101
URL: https://www.javascriptbank.com/binary-101.html



JavaScript
<SCRIPT>b1=0b2=0b3=0b4=0b5=0b6=0b7=0b8=0function binaryit(e){vtbu=event.keyCode;window.status=(event.keyCode);if (vtbu>127) {b1=1; vtbu=vtbu-128};if (vtbu<128) {if (vtbu>63) {b2=1; vtbu=vtbu-64}};if (vtbu<64) {if (vtbu>31) {b3=1; vtbu=vtbu-32}};if (vtbu<32) {if (vtbu>15) {b4=1; vtbu=vtbu-16}};if (vtbu<16) {if (vtbu>7) {b5=1; vtbu=vtbu-8}};if (vtbu<8) {if (vtbu>3) {b6=1; vtbu=vtbu-4}};if (vtbu<4) {if (vtbu>1) {b7=1; vtbu=vtbu-2}};if (vtbu<2) {if (vtbu>0) {b8=1; vtbu=vtbu-1}};if (event.keyCode==16) {b1=""; b2=""; b3=""; b4=""; b5=""; b6=""; b7=""; b8=""};if (event.keyCode==20) {b1=""; b2=""; b3=""; b4=""; b5=""; b6=""; b7=""; b8=""};if (event.keyCode==17) {b1=""; b2=""; b3=""; b4=""; b5=""; b6=""; b7=""; b8=""};if (event.keyCode==18) {b1=""; b2=""; b3=""; b4=""; b5=""; b6=""; b7=""; b8=""};if (event.keyCode==8) {b1=""; b2=""; b3=""; b4=""; b5=""; b6=""; b7=""; b8=""};b.value=b.value+b1+b2+b3+b4+b5+b6+b7+b8b1=0; b2=0; b3=0; b4=0; b5=0; b6=0; b7=0; b8=0;}</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<CENTER><INPUT id=input1 onkeyup=binaryit(event); style="WIDTH: 100%" onfocus="if (this.value=='Enter your text here. Text will be translated into binary in the box below.') {this.value=''}" value="Enter your text here. Text will be translated into binary in the box below."></CENTER><BR><CENTER><TEXTAREA onpaste="return false; " id=b style="WIDTH: 100%; COLOR: lightgreen; HEIGHT: 300px; BACKGROUND-COLOR: black" oncopy="alert('Binary successfully added to clipboard...')" value=""></TEXTAREA><BR><INPUT onclick="b.value=b.value+'00010100'" type=button value="Caps Lock"><INPUT onclick="b.value=b.value+'00010000'" type=button value=Shift><INPUT onclick="b.value=b.value+'00010001'" type=button value=Control><INPUT onclick="b.value=b.value+'00010010'" type=button value=Alt><INPUT onclick="b.value=b.value+'00001000'" type=button value=Backspace></CENTER><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->