![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
other
xboyhjm
这个作者很懒,什么都没留下…
展开
-
javascript 日期减一天
[code="js"] var d1=new Date( "2004/02/1 "); var d2=new Date(d1); d2.setFullYear(d2.getFullYear()-1); d2.setDate(d2.getDate()-1); alert(d2); alert(d2.getYear()+ "" +d2.getMonth()+1 + ...原创 2011-04-25 10:02:54 · 185 阅读 · 0 评论 -
javascript中保留N位小数点
[code="js"] function formatFloat(src, pos){ return Math.round(src*Math.pow(10, pos))/Math.pow(10, pos); } alert(formatFloat("321.32838",2)); [/code]原创 2011-03-14 13:03:13 · 81 阅读 · 0 评论 -
动态新建span,input,select,TABLE 行列
[code="js"]/* * 参数 : * textValue: 文本值( 欲新建文本单元格文本值 ) * idName : ID 值 ( 欲新建文本单元格ID ) */ function createTextE(obj,idName,textValue){ var span=document.createElement("span"); span.setAttribute...原创 2011-04-06 11:44:41 · 355 阅读 · 0 评论