Set innerHTML of Span in Modal

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();

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>';
        }
    );
});

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.
LVL 5
Daniel PineaultPresident / Owner CARDA Consultants Inc.Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
references :
https://api.jquery.com/html/
http://api.jquery.com/wrap/
http://api.jquery.com/wrapinner/

$('#modalPopup #modalHeader #modalHeaderTitle').html('<h4>' + $(this).attr('title') + '</h4>');

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Daniel PineaultPresident / Owner CARDA Consultants Inc.Author Commented:
Thank you.  I was sure I had already tried that, but apparently not.  Thank you for the links.  I will take some time tomorrow to look them over and try to get up to speed properly.  Thank you once again, your help was greatly appreciated!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.