Javascript & JQuery & CSS > example - 주민등록번호 체크
등록일 : 2017-07-04 19:25
조회수 : 94,984
자바 스크립트를 이용한 주민등록번호 체크
function Jumin_chk(it)
{
idtot=0;
idadd="234567892345";
for(i=0;i<12;i++)
{
idtot=idtot+parseInt(it.substring(i,i+1))*parseInt(idadd.substring(i,i+1));
}
idtot=11-(idtot%11);
if (idtot==10) idtot=0
if (idtot==11) idtot=1
if (idtot==12) idtot=2
if (idtot==13) idtot=3
if (idtot==14) idtot=4
if (idtot==15) idtot=5
if (idtot==16) idtot=6
if (idtot==17) idtot=7
if (idtot==18) idtot=8
if (idtot==19) idtot=9
if((it.substring(12,13))==idtot)
{ return true; }
else
{ return false;}
}
필요하신분 사용하세요.
그럼!