Sep 20, 2019
4
Level 5
document.execcommand(' bold') not working
I am trying to create a content editable div for blog page. In it my document.execCommand(' bold') is not working properly. It sets the font to bold but does not go back to normal if I click the button again. Other buttons such as those for italics etc work properly. Does anyone have a solution for this?
Level 5
I found out what was wrong. It was specific to Laravel. When I looked at developer tools,I saw that the font-weight was based on app.css. Once I disabled app.css, the command is working properly and I can toggle the bold easily inside contenteditable div. Boostrap and other styling will need to done separately since we lose the automatic styling.
Please or to participate in this conversation.