I'm using this javascript code (which I found here!) to change the content of a DIv : Starting with this: <script type="text/javascript"><!-- function ReplaceContentInContainer(id,content) { var container = document.getElementById(id); container.innerHTML = content; } //--></script> Then I call that function from within another function which is used to give the answer to some quiz question: <script type="text/javascript"><!-- function Drep() // function that gives the answer { content = 'The answer is <b>TV</b>. <a href="fiche.php?code=TV" rel="clearbox[width=720,,height=500,,dlinsame]">More info</a>'; ReplaceContentInContainer('reponse',content); } //--></script> The content of the DIV changes, I can see the text and link, but... The <rel> attribute of the <a href> won't work. When I click the link, it opens a new page instead of opening the clearbox window. I have copied/pasted the exact same code (<a href="fiche.php?code=TV" rel="clearbox[width=720,,height=500,,dlinsame]">More info</a>) into my page and then it works with the clearbox. Anyone can help me?
|