---
title: " JQuery datepicker 用法  jQuery UI很强大，其中的日期选择"
author: "rainyear"
date: "2012-09-04T12:41:17Z"
tags: []
categories: ["非技术"]
slug: "jquery-datepicker-jquery-ui"
draft: false
lastmod: "2012-09-26T22:43:52Z"
id: 1671068
url: "https://rainyear.iteye.com/blog/1671068"
---

jQuery UI很强大，其中的日期选择插件Datepicker是一个配置灵活的插件，我们可以自定义其展示方式，包括日期格式、语言、限制选择日期范围、添加相关按钮以及其它导航等。  
官方地址：[http://docs.jquery.com/UI/Datepicker](http://docs.jquery.com/UI/Datepicker) ，官方示例： [http://jqueryui.com/demos/datepicker/](http://jqueryui.com/demos/datepicker/) 。

一个不错的地址，用来DIY jQuery UI界面效果的站点[http://jqueryui.com/themeroller/](http://jqueryui.com/themeroller/)

DatePicker基本使用方法：

 

[![复制代码](http://common.cnblogs.com/images/copycode.gif)]()

&lt;! DOCTYPE html &gt;  
&lt; html &gt;  
&lt; head &gt;  
   &lt; link  href ="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"  rel ="stylesheet"  type ="text/css" /&gt;  
   &lt; script  src ="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" &gt;&lt;/ script &gt;  
   &lt; script  src ="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" &gt;&lt;/ script &gt;

   &lt; script &gt;  
  $(document).ready( function () {  
    $( " #datepicker " ).datepicker();  
  });  
   &lt;/ script &gt;  
&lt;/ head &gt;  
&lt; body  style ="font-size:62.5%;" &gt;

&lt; div  type ="text"  id ="datepicker" &gt;&lt;/ div &gt;

&lt;/ body &gt;  
&lt;/ html &gt;