a> HTML<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script><link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"><script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script><input type="date"> JS$(document).ready(function() { if (!Modernizr.inputtypes.date || $(window).width() >= 900) { $('input[type=date]').datepicker(); }});$(window).resize(function() { if (!Modernizr.inputtypes.date || $(window).width() >= 900) { $('input[type=date]').datepicker(); } else { $('input[type=date]').datepicker("destroy"); }}); CSSinput[type=date]::-webkit-inner-spin-button, input[type=date]::-webkit-calendar-picker-indicator { display: none; -webkit-appearance: none;}推荐答案 Edge中的本机日期控制功能(虽然Chrome可以通过黑客) -It is not possible to disable the native datepicker control functionality in Edge (although Chrome can via a hack)- yet anyway.除非由浏览器设计,输入控件通常基于/是系统控件。这意味着输入日期戳是输入日期戳, select 下拉列表是 select 下拉列表。Input controls, unless designed by the browser are generally based on/are system controls. This means an input datepicker is an input datepicker, and a select drop down list is a select drop down list.大多数控件在定制方面受限,除了基本样式,如边框,填充和字体样式,以及HTML标准属性。 占位符。Most controls are limited in customisation apart from basic styling like borders, padding and font styling, and HTML-standards attributes e.g. placeholder.您有几个选项: 保留默认的datepicker控件这是我将推荐的选项。使用默认系统控件(+适用的样式)通常是最好的策略。这可确保最大限度的设备兼容性,以及您的用户的熟悉程度。此外,一切通常只是工作。This is the option I will recommend. Sticking with the default system controls (+ styling where applicable) is usually the best policy. This ensures maximum device compatibility, and familiarity for your users. Plus, everything normally 'just works'. 恶意选项:浏览器检测Evil Option: Browser Detection您可以检测浏览器是否在您的JS代码中的Edge,然后指定它呈现jQuery控件。你应该避免这种情况,除非你真的需要它,因为浏览器检测变得过时,维护噩梦很快。You could detect if the browser is Edge in your JS code, and then tell it to render the jQuery control instead. You should avoid this unless you really need it, as browser detection becomes out-of-date and a maintenance nightmare pretty quick. 这篇关于如何禁用Microsoft Edge中的日期选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!