While I am utilizing document.execCommand to bold and underline text, what I really need is a button that can unbold the text and remove any underlining instead of just toggling them. Unfortunately, using execCommand("removeFormat") is causing some issues within my program. Do you know of any workaround I could use to achieve this unbolding/un-underline effect?
window.addEventListener('keydown', function (event) {
if (event.altKey){
if (event.code === 'Digit1') {
// Unbold, unhighlight, un-underline //
document.execCommand("hiliteColor", false, "transparent")
changeFont('7.5pt') /* This goes into a function to change the fontsize */
}