这是我的HTML文件
Image Gallery
Snapshots
Choose an image.
这是我的JS
function showPic(whichpic){
var source=whichpic.getAttribute("href");
var placeholder=document.getElementById("placeholder");
placeholder.setAttribute("src",source);
var text=whichpic.getAttribute("title");
var description=document.getElementById("description");
description.firstChild.nodeValue=text;
}
我把`var text=whichpic.getAttribute("title");
var description=document.getElementById("description");
description.firstChild.nodeValue=text;
这块删掉就可以正常运行函数 加上之后就运行不了 重打了好多次 也检查了 还是
不行 只好求助 那位大哥帮忙看下`
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
这一句的id值应为"description",拼写错误