Datepicker: Use button instead of a link in icon trigger demo

This commit is contained in:
Felix Nagel 2015-09-02 22:46:57 +02:00
parent 430715b206
commit e6fe401329

View File

@ -18,15 +18,14 @@
} ), } ),
widget = datepicker.datepicker( "widget" ); widget = datepicker.datepicker( "widget" );
$( "<a href='#'>") $( "<button>" )
.append( "<img src='images/calendar.gif' tabindex='0' alt='Open Datepicker'>" ) .append( "<img src='images/calendar.gif' alt='Open Datepicker'>" )
.insertAfter( datepicker ) .insertAfter( datepicker )
.on( "click", function( event ) { .on( "click", function() {
allowOpen = true; allowOpen = true;
if ( widget.is( ":hidden" ) ) { if ( widget.is( ":hidden" ) ) {
datepicker.focus(); datepicker.focus();
} }
event.preventDefault();
}); });
</script> </script>
</head> </head>