存档js

//2022-07-15 ajax
var jstest = document.getElementById("test");
// $("#test").text(year + "年");//test
// document.getElementsById("test").value = year;
// var x=document.getElementsByName("test");
window.onload = function ztgongbao(a,b){
var date_now = new Date();
var year = date_now.getFullYear();

document.getElementById('test').innerText =year;
// document.getElementById('test').innerHTML =jstest;
var  mychar=document.getElementById("test").innerHTML
// alert(mychar);
$("#inputyear").text(mychar + "年");
var options=document.getElementById("select_test").options;
options[0].setAttribute("selected","selected");
}

  

//2022-07-15 ajax
var jstest = document.getElementById("test");
// $("#test").text(year + "年");//test
// document.getElementsById("test").value = year;
// var x=document.getElementsByName("test");
window.onload = function ztgongbao(a,b){
var date_now = new Date();
var year = date_now.getFullYear();
document.getElementById('test').innerText =year;
// document.getElementById('test').innerHTML =jstest;
// var  mychar=document.getElementById("test").innerHTML
// alert(mychar);
// $("#inputyear").text(mychar + "年");
// var options=document.getElementById("select_test").options;
// options[0].setAttribute("selected","selected");
}

  

//2022-07-15 ajax
var jstest = document.getElementById("test");
// $("#test").text(year + "年");//test
// document.getElementsById("test").value = year;
// var x=document.getElementsByName("test");
window.onload = function ztgongbao(a,b){
var date_now = new Date();
var year = date_now.getFullYear();
document.getElementById('test').innerText =year;

//2018-now
for(var i=2018; i<=year;i++){
    var option = document.createElement('option');
    option.setAttribute('value',i);
    option.innerHTML = i;
    sel1.appendChild(option);
}
//1-12期
for(var i = 1; i <=12; i++){
    var option = document.createElement('option');
    option.setAttribute('value',i);
    option.innerHTML = i;
    sel2.appendChild(option);    
}

//
for(var i = 1; i <=31; i++){
    var option = document.createElement('option');
    option.setAttribute('value',i);
    option.innerHTML = i;
    sel3.appendChild(option);    
}
//
    if(sel1.value !='year' && sel2.value != 'month' && sel3.value !='day'){
        var day = new Date(sel1.value,sel2.value-1,sel3.value).getDay();
        result.innerHTML = sel1.value + '年' + sel2.value + '月' +  sel3.value + '日' + '星期' + changDay(day);
    }else{
        result.innerHTML = '';
    }
//
// document.getElementById('test').innerHTML =jstest;
// var  mychar=document.getElementById("test").innerHTML
// alert(mychar);
// var options=document.getElementById("select_test").options;
// options[0].setAttribute("selected","selected");
}

  

posted @ 2022-07-13 20:11  飞雪飘鸿  阅读(39)  评论(0编辑  收藏  举报
https://damo.alibaba.com/ https://tianchi.aliyun.com/course?spm=5176.21206777.J_3941670930.5.87dc17c9BZNvLL