Skip to content Skip to sidebar Skip to footer

Jquery .load - How To Target The Loaded File With Javascript And Jquery

If I have a template index.html and use jquery.load to include a file with html e.g $('#targetDiv').load( 'includes/inc1.html' ); into it. How do I target the content in inc1.html

Solution 1:

What I suggested in the comments about setting a callback function.

$('#targetDiv').load( 'includes/inc1.html', function(){
    $('#content').html("20");
});

Post a Comment for "Jquery .load - How To Target The Loaded File With Javascript And Jquery"