Hello, you can try this one: <input onclick="showcalendar(event, this)" onfocus="showcalendar(event, this)" size=24 name=birthday> JS code: var userAgent = navigator.userAgent.toLowerCase(); var is_webtv = userAgent.indexOf('webtv') != -1; var is_saf = userAgent.indexOf('applewebkit') != -1 || navigator.vendor == 'Apple Computer, Inc.'; var is_opera = userAgent.indexOf('opera') != -1 && opera.version(); var is_moz = (navigator.product == 'Gecko' && !is_saf) && userAgent.substr(userAgent.indexOf('firefox') + 8, 3); var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera && !is_saf && !is_webtv) && userAgent.substr(userAgent.indexOf('msie') + 5, 3); var controlid = null; var currdate = null; var startdate = null; var enddate = null; var yy = null; var mm = null; var currday = null; var addtime = false; var today = new Date(); var lastcheckedyear = false; var lastcheckedmonth = false; function $(id) { return document.getElementById(id); } function doane(event) { e = event ? event : window.event ; if(is_ie) { e.returnValue = false; e.cancelBubble = true; } else { e.stopPropagation(); e.preventDefault(); } } function loadcalendar() { s = '<style type="text/css">'; s += '.calendar_header {text-align: center;BORDER: #698CC3 1px solid; BACKGROUND: white; outline: 1px solid #698CC3}'; s += '.calendar_checked A { COLOR: #FFF; background:#698CC3;}'; s += '.calendar_expire A:link { COLOR: #999;}'; s += '.calendar_default A:link { COLOR: #000;}'; s += '.calendar_today A:link { display: inline-block;COLOR: #9EB6D8; border:1px solid #698CC3; padding:1px;}'; s += '.calendar_expire A:hover,.calendar_today A:hover,.calendar_default A:hover { COLOR: #FFF; background:#9EB6D8;}'; s += '#calendar_year,#calendar_month { Z-INDEX: 10; DISPLAY: none; POSITION: absolute;}'; s += '</style>'; s += '<div id="calendar" style="display:none; position:absolute; z-index:9;" onclick="doane(event)">'; s += '<div style="width: 180px;"><table cellspacing="0" cellpadding="0" width="100%" style="text-align: center;BORDER: #698CC3 1px solid; BACKGROUND: white; outline: 1px solid #698CC3">'; s += '<tr align="center" bgcolor="#E3EFFF"><td height=20><a onclick="refreshcalendar(yy, mm-1)" title="上一月"><<</a></td>'; s += '<td colspan="5" style="text-align: center"><a onclick="showdiv(\'year\');doane(event)" title="点击选择年份"><span id="year"