【问题标题】:<input type="date"> is not working in mozilla<input type="date"> 在 Mozilla 中不起作用
【发布时间】:2016-02-18 10:45:20
【问题描述】:
<!DOCTYPE html>
<html>
<body>

<form>
  Birthday: <input type="date" id="datepicker">
  <input type="submit">
</form>

</body>
</html>

我想从日历中选择日期。我使用了来自 HTML5 的日期输入 此代码在 IE 和 Chrome 中运行良好 并且不在 Mozilla 中工作 请帮我修复代码

【问题讨论】:

标签: javascript php html date


【解决方案1】:

HTML 元素是用于创建接受日期的输入字段的元素的特定版本。

浏览器生成用于输入和更改日期的控件。此日期包括年、月和日。控件本身因浏览器而异; browsers not supporting这种类型会显示一个简单的文本控件。

Read more

use datetime picker jquery plugin  will be a good option 

Read this

或者试试这个代码:-

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>
</head>
<body>

<p>Date: <input type="text" id="datepicker"></p>


</body>
</html>

【讨论】:

    猜你喜欢
    • 2016-04-14
    • 1970-01-01
    • 2015-01-11
    • 2018-10-12
    • 1970-01-01
    • 2017-07-03
    • 1970-01-01
    • 1970-01-01
    • 2019-03-10
    相关资源
    最近更新 更多