随笔分类 -  JAVASCRIPT

js 工具函数
摘要:一、document.getElementByIdfunction $(id){ return document.getElementById(id);} $("id").value二、生成select的optionvar _option = $("id");_option.options[0]=new Option("Name","value"); 生成:<option value="value">Name</option>//var id = "{\&quo 阅读全文

posted @ 2011-11-28 19:22 贾吾 阅读(190) 评论(0) 推荐(0)

JS 日期时间
摘要:js 获取当前yyyy-MM-dd 格式日期 var now = new Date(); var nowDate = now.getFullYear()+"-"+(now.getMonth()+1)+"-"+now.getDate();以下摘自http://www.w3school.com.cn/js/jsref_obj_date.aspDate() 返回当日的日期和时间。 getDate() 从 Date 对象返回一个月中的某一天 (1 ~ 31)。 getDay() 从 Date 对象返回一周中的某一天 (0 ~ 6)。 getMonth() 从 D 阅读全文

posted @ 2011-11-28 18:55 贾吾 阅读(276) 评论(0) 推荐(0)

导航