I am using document.execCommand to bold and underline text, but I want to make a button that forces the text to be unbolded and not underlined, rather than simply toggling. I can’t use execCommand(“removeFormat”) either, as it is causing issues in my program. Is there a work around I can use to unbold/un-underline the text?
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 */
}