웹&컴퓨팅

charCodeAt

x2chi 2007. 12. 25. 03:17
반응형
<html>
<head>

<script>

function chkonlyengnum(strValue)
{
var intErr;
var retCode = 0;
var intErr = 0;
var RLT = '';
for (var i=0; i<strValue.length; i++)
{
  var retChar = strValue.substr(i,1).toUpperCase();
  var retCode = retChar.charCodeAt(0);
   
  retCode = parseInt(retCode);
 
  RLT += retChar+'='+retCode+'<br />';
}

document.getElementById('r').innerHTML = RLT;
}
</script>
</head>
<body onLoad="chkonlyengnum('abcdedfhijklmnopqrstuvwxyz0123456789');">
 
  <div id="r"></div>
</body>
</html>


A=65
B=66
C=67
D=68
E=69
D=68
F=70
H=72
I=73
J=74
K=75
L=76
M=77
N=78
O=79
P=80
Q=81
R=82
S=83
T=84
U=85
V=86
W=87
X=88
Y=89
Z=90
0=48
1=49
2=50
3=51
4=52
5=53
6=54
7=55
8=56
9=57


/**
* 특수 문자 들 번호
*/
!=33
"=34
#=35
$=36
%=37
&=38
'=39

*=42
+=43
,=44
.=46
/=47

:=58
;=59

<=60
==61
>=62
?=63
@=64


[=91
]=93
^=94
`=96


{=123
}=125
~=126
반응형