hi there
i have a scenario where i am trying to read the value within a div in a html page and pass that value to a server via ajax:

var formname = document.getElementById('username').innerHTML;

type: "POST",
url: "postForm.ajax.php",
dataType: "json",

success: function(msg)
//do stuff



however it seems as though the dom is generated before the html stuff is complete therefore the variable formname contains null and not "paulSm". Is there any way around this problem?
Any help you can give me would greatly be appreciated