help acessing element that's not loaded on the page - newbie
hello i have the following code
<script type="text/javaScript">
$(document).ready(function(){
$("#dropPrd").change(function() {
$('#imgAjaxLoading').ajaxStart(function(){
$('#imgAjaxLoading').show();
$('#imgAjaxLoading').attr("src","/images/loading.gif");
$("#FirstResult").hide();
});
$('#imgAjaxLoading').ajaxStop(function(){
$('#imgAjaxLoading').hide();
$("#FirstResult").show();
});
$.ajax(
{
type: "POST",
url: "AjaxGetSubProducts.php",
data: "action=getSubProductTypes&subPrdId="+this.value,
dataType: "html",
success: function(msg){
if(msg != 'empty')
{
$("#FirstResult").html('<fieldset class="second"><legend>Sub-Produtos</legend><p class="left">'
+msg+' <img name="imgAjaxLoading2" id="imgAjaxLoading2" style="display: none;" alt="" src="">\n\
<input type="checkbox" name="checkSubProduct" id="checkSubProduct" value="xxx">Não desejo utilizar este campo</input></p></fieldset>');
}else{ $("#FirstResult").html('<font color="Red" face="Arial">A seleção acima feita não apresenta resultados</font>');}
}
});
});
});
</script>
and i want to access the element dropSubPrd that is inserted on that ajax function, on the div FirstResult, but it will not work in $('document').ready because when the page load's that element isnt there.
can anyone help me?