Traditional Culture Encyclopedia - The 24 Solar Terms - How does js get the current year and the current year-1
How does js get the current year and the current year-1
The test was successful.
& lthtml & gt
& ltinput type="text" id="prev " >
& ltinput type = " text " id = " now " & gt
& ltinput type="text" id="next " >
& lt/html & gt;
& ltscript type = " text/JavaScript " & gt;
window.onload = function(){
getYear();
};
Function getYear(){
Function getEle(id){
Returns document. getelementbyid (id);
}
var inputPrev = getEle("prev "),
inputNow = getEle("now "),
inputNext = getEle("next "),
D = new date (),
now year =+d . get full year();
inputNow = nowYear
input prev . value = now year- 1;
input next . value = now year+ 1;
}
& lt/script & gt;
- Related articles
- How to beat eggs in long summer?
- Ask the master to approve the eight characters in detail
- Is the 20 13 Chevrolet static throttle electronic or not?
- What is the age of the middle-aged and elderly people in the eight characters?
- Climatic characteristics of solar terms in Grain Rain What's the weather like in Grain Rain?
- What percentage of throttle position sensors are used in motorcycle Ye Sheng system?
- Solar term moxibustion Sanjiu copywriting
- Dinner from winter to Sunday is very grand. In many places, the dishes on the table have other names, such as jiaozi, which is also called ().
- What season is pomegranate fire turning red?
- Why do some Nissan cars have high idle speed after cleaning the throttle?