JavaScript version of date input control (2)

Source: Internet
Author: User
Control Obj_year.innertext=parseint (num_year) +1; Number of years increased

Displaycalendar (Obj_month.innertext-1,obj_year.innertext);
}
function Plusyear ()
{

var Obj_year=document.getelementbyid ("year");
var Obj_month=document.getelementbyid ("month");

var Num_year=obj_year.innertext;
Obj_year.innertext=parseint (Num_year)-1; Decrease in number of years

Displaycalendar (Obj_month.innertext-1,obj_year.innertext);
}
function Addmonth ()
{

var Obj_month=document.getelementbyid ("month");
var Obj_year=document.getelementbyid ("year");

if (parseint (obj_month.innertext) >=12)//The number of months increases to 12 o'clock, the number of years corresponds to a corresponding increase of 1, the number of months starting from 1
{
obj_month.innertext= "0";
Obj_year=document.getelementbyid ("year");
var Num_year=obj_year.innertext;
Obj_year.innertext=parseint (num_year) +1;
}

var Num_month=obj_month.innertext;
Obj_month.innertext=parseint (num_month) +1; Increase in the number of months

Displaycalendar (Obj_month.innertext-1,obj_year.innertext);
}
function Plusmonth ()
{

var Obj_month=document.getelementbyid ("month");
var Obj_year=document.getelementbyid ("year");

if (parseint (obj_month.innertext) <=1)//The number of months reduced to 1 o'clock, the number of years decreased by 1, the number of months starting from 12
{
obj_month.innertext= "13";
Obj_year=document.getelementbyid ("year");
var Num_year=obj_year.innertext;
Obj_year.innertext=parseint (Num_year)-1;
}

var Num_month=obj_month.innertext;
Obj_month.innertext=parseint (Num_month)-1; Reduced number of months



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.