Hi guys,
I got a javascript file like below :
var nl = document.createElement(‘a’);
nl.setAttribute(‘href’, ‘
nl.setAttribute(‘title’, ‘Pikepier’);
nl.setAttribute(‘rel’, ‘gb_page_center[500,550]’);
nl.innerHTML = ‘Send Email’;
var pp = document.getElementById(‘pikepier’);
pp.appendChild(nl);
and my html page is like below:
<html>
<body>
<head></head>
<div id=”pikepier”></div>
<script type=”text/javascript” src=”scripts/pikepier.js”></script>
</body>
</html>
and everythings just work fine.
However, when I put the
<script type=”text/javascript” src=”scripts/pikepier.js”></script>
with the head section, the
document.getElementById(‘pikepier’);
is null.
Please advice. Thanks in advance !
regards,
Mark