Code below is the code with my question.
var links=content.getElementsByTagName("a");
for(var i=0;i<links.length;++i)
{
links[i].onclick=function()
{
document.getElementById("placeholder").setAttribute("src",this.href);
return false;
};
}
Here I try to add onclick functions to the links and I succeed in making this by using the code above. However, if I replace the this.href with links[i].href, the default event of switching page appears. I want to know the reason.