JSFiddle - React, Tailwind, and code Playground
HTML
<div><span class="note_message">The order was manually edited:<br/>The list of edits goes here, and this maybe somewhat long sometimes</span>
</div>
CSS
#myButton
{
display: none;
}
JavaScript
$(function(){
var messageText = $('.note_message').html()
var staticText = 'The order was manually edited:<br/>';
var dynamicText = messageText.substring(staticText.length-1);
var newHTML = staticText + '<span id="editsToHide">'+dynamicText+'</span>'
$('.note_message').html(newHTML).after($('<button id="myButton">Show Edits</button>'));
$('#editsToHide').hide();
$('#myButton').show().click(
function(){
$('#editsToHide').toggle();
if ($('#editsToHide').is(":visible"))
{
$('#myButton').text('Hide Edits');
}
else
{
$('#myButton').text('Show Edits');
}
}
);
})