支付宝赞助帐号:service@kuitao8.com 

单击文本框可以插入时间

Created2013-07-21   Views 2102    Author 懒人程序
<head>
<script type="text/javascript">
    var datefield=document.createElement("input")
    datefield.setAttribute("type""date")
    if (datefield.type!="date"){ //if browser doesn't support input type="date", load files for jQuery UI Date Picker
        document.write('<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />\n')
        document.write('<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"><\/script>\n')
        document.write('<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"><\/script>\n')
    }
</script>
 
<script>
if (datefield.type!="date"){ //if browser doesn't support input type="date", initialize date picker widget:
    jQuery(function($){ //on document.ready
        $('#birthday').datepicker();
    })
}
</script>
</head>
 
<body>
<form>
<b>Date of birth:</b>
<input type="date" id="birthday" name="birthday" size="20" />
<input type="button" value="Submit" name="B1"></p>
</form>
</body>

上一篇: JAVASCRIPT之灰色按钮
下一篇: Ajax和Jquery基础入门视频
支持键盘 ← →

邮件订阅

订阅我们的精彩内容