8월, 2017의 게시물 표시

[JS] 금액 콤마

//콤마찍기 function  comma(str) {     str  =   String (str);      return  str.replace( / (\d)(? = (?:\d{ 3 }) + (? ! \d)) / g,  '$1,' ); }   //콤마풀기 function  uncomma(str) {     str  =   String (str);      return  str.replace( / [^\d] + / g,  '' ); }   //값 입력시 콤마찍기 function  inputNumberFormat(obj) {     obj.value  =  comma(uncomma(obj.value)); }   //<input type="text" onkeyup="inputNumberFormat(this)" /> 출처 : http://dlevelb.tistory.com/829

[JS] 금액 콤마

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="ko"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <style type="text/css"> *{margin:0;padding:0;} </style> </head> <body> <div class="set po1"> <input type="text" name="item01" id="item01" readonly="readonly" value="1" /> <a href="#" class="btn_act1">+</a> <a href="#" class="btn_act2">-</a> </div> <div class="set po2"> <input type="text" name="item02" id=&qu