글

라벨이 금액콤마인 게시물 표시

[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=...

[jQuery] 금액단위 제거 표기

구글신에겐 역시 없는게 없다... http://jsfiddle.net/praveenscience/R8JrF/1/ <table id="price"> <tr> <td class="price_01">700,000</td> <td>5,000</td> <td class="price_rs"></td> </tr> <tr> <td class="price_01">600,000</td> <td>3,000</td> <td class="price_rs"></td> </tr> <tr> <td class="price_01">500,000</td> <td>7,000</td> <td class="price_rs"></td> </tr> </table> <script type="text/javascript"> $(".price_01").each(function(){ var price_01 = $(this).html().replace(/,/g, ""); var price_02 = $(this).next().html().replace(/,/g, ""); var price = (price_01-price_02).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") var price_rs = $(this).next().next(".price_rs"...