首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

为何小弟我的javascript在ie9起不了作用?

2012-08-31 
为何我的javascript在ie9起不了作用??节选代码function showPic(whichpic){var sourcewhichpic.getAttrib

为何我的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].存在吗

热点排行