本文介紹了HTML 輸入類型日期,默認打開日歷的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我有一個任務是默認顯示日歷以在 html 的輸入字段中選擇日期.
I have a task which is to show the calendar by default to select date in the input field of html.
假設這是代碼:
input type="date" name="bday"
好的,現在當我點擊輸入框時,會出現日歷.
Ok, now when I click on the input box, the calendar appears.
告訴我如何在不點擊輸入的情況下默認顯示日歷.
Tell me how to show the calendar by default without clicking on the input.
推薦答案
這對于原生 HTML 輸入元素是不可能的.您可以使用 webshim polyfill,它通過使用此標記為您提供此選項.
This is not possible with native HTML input elements. You can use webshim polyfill, which gives you this option by using this markup.
<input type="date" data-date-inline-picker="true" />
這是一個小演示
這篇關于HTML 輸入類型日期,默認打開日歷的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!