In HTML, a form comprises of various elements which helps in making a user interface in a web page. Using which we can collect different nature of nature.
#One of the commonly used control is
Monthcontrol i.e.
這個控制項基本上為使用者提供了一個類似日曆的下拉式選單,使用者可以從中選擇或選擇月份和年份。
月份讓我們來看一個簡單的範例,使用
Month控制項。 範例
<html> <body> <form name="form1"> <label for="adm">Date of Admission:</label> <input type="month" name="doa"> </form> </body> </html>
Executing the code given above, a month control will be displayed on the page.
When you click on the calendar icon on the right side of the control, it will open the complete month calendar like this −
<html> <head> <title>Admission Form</title> <script> function display(){ d=form1.doa.value; document.write("<center><b>Date of Admission is "+d +"</b></center>"); } </script> <form name="form1"> <label for="adm">Date of Admission:</label> <input type="month" name="doa" onchange="display()"> </form> <html>