日期:2014-05-16  浏览次数:20286 次

为何我的javascript在ie9起不了作用??
节选代码
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.childNodes[0].nodeValue=text;
 return false;}
<a href="images/firework.jpg" onclick="return showPic(this); " title="A fireworks display">Firework</a>
除了ie9firefox,safari等都ok啊

------解决方案--------------------
最好
description.innerHTML = text;

description.childNodes[0].存在吗