I'm trying to open a modal and then set the innerHTML of a span, but can't seem to get it working.
The modal is
Modal::begin([
//'header'=>'<h4>Add a New Company</h4>',
//'headerOptions' => ['id' => 'modalHeader'],
'id'=>'modalPopup',
'class'=>'modalPopup',
'size'=>'modal-lg',
'header' => '<span id="modalHeaderTitle"></span>',
'headerOptions' => ['id' => 'modalHeader'],
'closeButton' => [
'label'=>'Close',
'id'=>'closeButton',
'class'=>'btn btn-warning pull-right',
],
'clientOptions' => [
'backdrop' => 'static', //true,
'keyboard' => false, // true,
]
]);
echo ' <div id="modal-system-messages" style="opacity: 1; display: none"></div>';
echo "<div id='modalContent'></div>";
Modal::end();
Select all Open in new window
And then my js for the calling button is
$(function(){
$('.showModal').click(
function (){
//Open the modal window
$('#modalPopup').modal('show')
.find('#modalContent')
.load($(this).attr('value'));
// Set the modal title span
// alert($(this).attr('title'));
$('#modalPopup #modalHeader #modalHeaderTitle').innerhtml = '<h4>' + $(this).attr('title') + '</h4>';
}
);
});
Select all Open in new window
I have validated that alert($(this).attr('title'
)); is returning the proper value but the .innerHTML line does nothing.
Thank you for your help.