Format Currency Sample
生活随笔
收集整理的這篇文章主要介紹了
Format Currency Sample
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
<!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"> <head> <title>JQuery FormatCurrency Sample</title> <script type="text/javascript" src="scripts/jquery-1.2.6.js"></script> <script type="text/javascript" src="scripts/jquery.formatCurrency.js"></script> <style type="text/css"> body, div { margin:0px auto; padding:0px; }.main { margin:40px; }.sample { float:left; margin:10px; padding:4px; border:1px solid #888; width:350px; }.sample h3 { margin:-4px; margin-bottom:10px; padding:4px; background:#555; color:#eee; }.currencyLabel { display:block; } </style> <script type="text/javascript"> // Sample 1 $(document).ready(function(){$('#currencyButton').click(function(){$('#currencyField').formatCurrency();$('#currencyField').formatCurrency('.currencyLabel');});}); // Sample 2 $(document).ready(function(){$('.currency').blur(function(){$('.currency').formatCurrency();});}); </script> </head> <body> <div class="main"> <div class="formPage"> <h1>Format Currency Sample</h1> <div class="sample"> <h3>Formatting Using Button Click</h3> <input type="textbox" id="currencyField" value="$1,220.00" /> <input type="button" id="currencyButton" value="Convert" /> <div> Formatting Currency to an Html Span tag. <span class="currencyLabel">$1,220.00</span> </div> </div> <div class="sample"> <h3>Formatting Using Blur (Lost Focus)</h3> <input type="textbox" id="currencyField" class='currency' value="$1,220.00" /> </div> </div> </div> </body> </html>轉(zhuǎn)載于:https://my.oschina.net/u/1047983/blog/138268
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的Format Currency Sample的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ubuntu配置×××后,配置走×××的
- 下一篇: 创业型软件公司的心得