With jQuery v3.2, I want to extract and remove "H1" from AJAX data :
$('.version-modal-show').click(function() {
var url = $(this).attr('href');
$.ajax({
url: url,
type: 'GET',
dataType: 'html',
success:function(d) {
console.log(d);
modal.setBody(d);
modal.open();
}
});
return false;
});
console.log(d) return html brut :
<h1>
<i class="fa fa-list" aria-hidden="true"></i>
Centre d'intérêt « TESTb »
</h1>
<p class="text-center">
<a href="/app_dev.php/administration/hobbies" class="btn btn-secondary">
<i class="fa fa-backward" aria-hidden="true"></i>
Retour aux centres d'intérêts
</a>
</p>
I want to remove the h1
from the modal.setBody()
but put it in the modal.setTitle()