js代码function showPig(whichpig){ var source=whichpig.getAttribute("href"); var placeholder=document.getElementById("placeholder"); placeholder.setAttribute("src",source);}js代码新增3条语句后 原先点击图片链接停留在当前页面和placeholder转为链接图片功能失效function showPig(whichpig){ var source=whichpig.getAttribute("href"); var placeholder=document.getElementById("placeholder"); placeholder.setAttribute("src",source); **var text=whichpig.getAttribute("title"); var description=getElementById("description"); description.firstChild.nodeValue=text;**}有趣的是,我对新增的三条语句逐条注释看看是哪条语句使得所有函数功能失效。是这一句:var description=getElementById("description");我使用的编辑器是sublime text3.那么如何才能实现所有功能呢?
添加回答
举报
0/150
提交
取消