I am loading another html page from an index page, then I would like to get an element from that loaded page, but the page seems not loaded yet since the element resulted to null, even if there is a function call back with in the ajax load function:
$(document).ready(function() {
$('#btnEdit').click(function(){
$('#contents').load("abcd.html",showNewcontents())
function showNewcontents() {
alert("" + document.getElementById("make").value);
}
return false;
});
});
in body:
<body>
<a href="click me" id="btnEdit" name="btnEdit">CLICK ME </a>
<div id="contents"></div>
</body>
in abcd.html:
<div id="contents">
<form>
<input type="hidden" id="make" name="make" value="make">
</form>
</div>
Any clue as to how to modify this to get the element?