JQUERY UI Datepicker Demo

datepicker_demo.htm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Date Picke Demo</title>
<script type="text/javascript" src="jquery-1.8.1.js"></script>
<script type="text/javascript" src="jquery-ui-1.8.23.custom.min.js"></script>
<script type="text/javascript" src="test.js"></script>
<script type="text/javascript">
$(window).load(function() {
    var myBirthday = new Date(1981,08,05);
    //$("#dpBirthday").datepicker('setDate', myBirthday);    
});
    function getDate(){
        alert($("#dpBirthday").val());
    }
</script>
</head>
<body>
<div>Birthday : <input type="text" id="dpBirthday" readonly="readonly"    style="width: 80px;" />    </div>
<div><input type="button" value="get date" onclick="getDate()"/></div>
</body>
</html>
View Code

test.js

$(function() {
    $("#dpBirthday").datepicker({
        changeMonth : true,
        changeYear : true,
        dateFormat : 'yy-mm-dd'
    });
});
View Code

 

posted @ 2015-08-24 17:27  bruceHuang  阅读(151)  评论(0编辑  收藏  举报