Uncaught TypeError: Cannot read properties of null (reading ‘value‘) 您所在的位置:网站首页 js课工场论坛列表 Uncaught TypeError: Cannot read properties of null (reading ‘value‘)

Uncaught TypeError: Cannot read properties of null (reading ‘value‘)

2022-12-27 17:33| 来源: 网络整理| 查看: 265

怎么解决

        课工场论坛列表         我要发帖                                     所属版块:             请选择版块             电子书籍             新课来了             新手报到             职业规划                                               function post(){             document.getElementById("post").style.display="block";         }         var tou=new Array("tou01.jpg","tou02.jpg","tou03.jpg","tou04.jpg");         function postSuccess(){             var newLi=document.createElement("li");             var iNum=Math.floor(Math.random()*4);             var touDiv=document.createElement("div");             var touImg=document.createElement("img");             touImg.setAttribute("src","images/"+tou[iNum]);             touDiv.appendChild(touImg);                  var titleH1=document.createElement("h1");         var title=document.getElementById("title").value;         titleH1.innerHTML=title;                  var newP=document.createElement("p");         var secName=document.createElement("span");         var secSelect=document.getElementById("sec").value;         secName.innerHTML="版块:"+secSelect;         var myDate=new Date();         var currentDate=myDate.getFullYear()+"-"+parseInt(myDate.getMonth()+1)+"-"+myDate.getDate()+" "+myDate.getHours()+":"+myDate.getMinutes();         var timeSpan=document.createElement("span");         timeSpan.innerHTML="发表时间:"+currentDate;         newP.appendChild("secName");         newP.appendChild("timeSpan");                  newLi.appendChild("touDiv");         newLi.appendChild("titleH1");         newLi.appendChild("newP");         var postList=document.getElementById("postList");         postList.insertBefore(newLi,postList.firstChild);            document.getElementById("title").value="";         document.getElementById("content").value="";         document.getElementById("post").style.display="none";         }     



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有