Could someone tell me how I can modify the html before I insert it into the document?
This is an AJAX call:
url: "http://localhost/cart/public/admin/album",
success: function(html) {
This is the result of the AJAX call:
<div class="main-content slide-in">
<h1>Create Album</h1>
<div class="inner">
</div>
</div>
All I want to do is change the color of the h1 tag. I have added this code
url: "http://localhost/cart/public/admin/album",
success: function(html) {
$(html).find('h1').css('color','red');
$('aside').after(html);
However this has no effect. The jQuery selector does seem to be working though.
url: "http://localhost/cart/public/admin/album",
success: function(html) {
$(html).find('h1').css('color','red');
console.log($(html).find('h1').length);
$('aside').after(html);
Using console.log correct outputs 1. So it is finding the h1. For some reason though the css style isn't being applied.
I am bit stuck. Am I missing a step?