director.js 222222222222222222222222
director.js 222222222222222222222222
操作方法
- 01
var table = S("directorDiv").getElementsByTagName("TABLE")[0]; //获取后台数据库数据 var directors = getDirectors(); //没有数据的情况 if(directors == null || directors.length < 1){ for(var i=0;i<5;i++){ var tr = document.createElement("TR"); tr.className = "director_tr"; var img = document.createElement("TD"); img.className = "director_td" + 2; img.innerHTML = "<img style='cursor:pointer;' onclick='newMusic(this)' src='images/" + i + ".png" +"'></img>"; tr.appendChild(img); for(var j= 0;j<4;j++){ var td = document.createElement("TD"); td.className = "director_td2"; tr.appendChild(td); } table.appendChild(tr); } return; }
- 02
//操作按钮 var showMore = document.createElement("TD"); showMore.className = "director_td2"; showMore.innerHTML ="<span style='width: 5px'> </span>" + "<label id='modify' onclick='modifyDirector(this)' style='color:blueviolet;width: 195px;height: 30px;background-color: bisque;text-align: center;line-height: 30px;cursor:pointer;'>修 改</label>" + "<span style='width: 5px'> </span>" + "<label id='delete' onclick='deleteDirector(this)' style='color:red;width: 195px;height: 30px;background-color: bisque;text-align: center;line-height: 30px;cursor:pointer;'>删 除</label>"; tr.appendChild(showMore); tr2.appendChild(td2); table.appendChild(tr); table.appendChild(tr2);