<html>
<head>
 <title></title>
 <script type="text/javascript">
 
 function commify(obj) {
  var n = obj.value;
  n = unNumberFormat(n);
    var reg = /(^[+-]?\d+)(\d{3})/;   // 정규식
    n += '';                          // 숫자를 문자열로 변환
    while (reg.test(n))
      n = n.replace(reg, '$1' + ',' + '$2');
   
    obj.value = n;     
 }

 function numberFormat(obj) {
  var pattern = /(-?[0-9]+)([0-9]{3})/;
  while(pattern.test(num)) {
   num = num.replace(pattern,"$1,$2");
  }
  return num;
 }

 //콤마제거
 function unNumberFormat(num) {
  return (num.replace(/\,/g,""));
 }  
 
</script>


 <input type=text name='aaaa' onkeyup="commify(this)"/>
</head>
<body>

</body>
</html>

여기저기 퍼와서 만들었다....