I am using jquery to display bootstrap modal and want to add custom message at runtime. Here is what I am doing? but wondering if there is a way to merge two lines into one:-
$("#modalBody").append("saved successfully");
$("#modal").modal("show");
Bootstrap Modal:-
<div id="modal" class="modal fade" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<a href="#" class="close" data-dismiss="modal">×</a>
</div>
<div id="modalBody" class="modal-body">
*adding custom message*
</div>
<div class="modal-footer">
<button class="btn btn-success" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
You could do it like this:
It's probably simple enough without combining them though.