If the div is part of the AJAX response:
$.ajax({
url: 'test.html',
dataType: 'html',
success: function(html) {
var div = $('#sourceDiv', $(html)).addClass('done');
$('#targetDiv').html(div);
}
});
More Related Contents:
- Hide/Show div on specific page with jquery
- How to get a cookie from an AJAX response?
- Ajax in Jquery does not work from local file
- How to render partial view in MVC5 via ajax call to a controller and return HTML
- jquery html() strips out script tags
- How does GitHub change the URL without reloading a page?
- Jquery and HTML FormData returns “Uncaught TypeError: Illegal invocation”
- Post JSON to Python CGI
- Google Map v3 auto refresh Markers only
- HTML5 validation before ajax submit
- HTML Web Worker and Jquery Ajax call
- HTML Anchor tag redirect link after ajax request
- What happens when no response is received for a request? I’m seeing retries
- How to make page loaders/animations/transitions
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- Jquery – How to make $.post() use contentType=application/json?
- Calling a ‘WebMethod’ with jQuery in ASP.NET WebForms
- How to set data attributes in HTML elements
- jQuery html() in Firefox (uses .innerHTML) ignores DOM changes
- Activate CSS3 animation when the content scrolls into view
- Jquery datepicker restrict dates in second date field based on selected date in first date field
- current/duration time of html5 video?
- How to bind to localStorage change event using jQuery for all browsers?
- Synchronous XMLHttpRequest warning and
- File Upload via AJAX within JQuery
- Selecting only first-level elements in jquery
- get html of external url in jquery
- How do I filter the returned data from jQuery.ajax()?
- Run JQuery in the context of another frame
- Get index of selected option with jQuery