日期:2014-05-17 浏览次数:20426 次
var img_click = function (n) {
var img = document.getElementsByTagName("img")[n];
if (img.alt == "加号") {
img.alt = "减号";
img.src = "images/小减号2.gif";
}
else if (img.alt == "减号") {
img.alt = "加号";
img.src = "images/小加号.gif";
}
}
var list1 = new Array();
list1[0] = "管理费用";
list1[1] = "税费";
var list2 = [["工资", "节日费"], ["国税", "地税"]];
window.onload = function () {
//上方还有部分正确的代码
var img_list = document.getElementsByTagName("img");
for (var i = 0; i < img_list.length; i++) {
if (img_list[i].style.display != "none") {
img_list[i].onclick = img_click(i);
}
}
}
function img_click(img){
if (img == null
------解决方案--------------------
img.currentTarget != null) img = this; //兼容ie
if (img.alt == "加号") {
img.alt = "减号";
img.src = "images/小减号2.gif";
}
else if (img.alt == "减号") {
img.alt = "加号";
img.src = "images/