So in my php page I have this code :
<div id="test"></div>
<script src="test.js"></script>
And in my external javascript I have :
document.getElementById('test').innerHTML=
"<div id='abc'><a href='index.html'><?php echo 'Welcome '.$_COOKIE['user'].'<br>' ;?></a></div>";
Cookie has been set and if I put the script inside the php page, it does work but why isn't it working when it is external script ? Did I do something wrong here ? or is there a rule for doing this ?
Please educate me. Thx in advance. =D