Get element using id problem
- by Ebe
I am modifying existing legacy webpages(which i shouldn't modify existing parts but adding) and the webpage uses document.write to write certain html elements. when i use
<script type="text/javascript" language="javascript">
var v = document.getElementById('td_date_cal_0');
alert(v);
</script>
v becomes null and when i create button and click
<input type="button" id="mnbutton" onclick="mnLoader();" value="Click Me!" />;
<script type="text/javascript" language="javascript" >
function mnLoader() {
var v = document.getElementById("td_date_cal_0");
alert(v);
} <br />
</script>
Any idea, how to get the element without need of user action, such as clicking?
Thanks,
Ebe