You can add a span around (2 free spaces)
with a class
so that you can refrence it in your css:
<h4 class="modal-title">Algebra I, Algebra II <span class="hide">(2 free spaces)</span></h4>
Then, in your css you can hide it by targetting the span's class
using display: none
:
.hide {
display: none
}
See working example below:
.hide {
display: none;
}
<h4 class="modal-title">Algebra I, Algebra II <span class="hide">(2 free spaces)</span></h4>
If you cannot add a span to your HTML or don't know the size the size of your title, you can use the following javascript:
let modal_title = document.querySelectorAll('.modal-title'); // get the modal title elements
modal_title.forEach(elem => { // loop over each element, where elem represents a given modal title
let txt_title = elem.textContent; // get the text from that given modal title
elem.innerHTML = txt_title.replace(/(\(\d+ free spaces\))/, "<span class='hide'>$1</span>"); // add the "hide" span around the title text using regex
});
.hide {
display: none;
}
<h4 class="modal-title">Algebra I, Algebra II (2 free spaces)</h4>
<h4 class="modal-title">Alg I, Alg II (10 free spaces)</h4>