M
M
Mikhail Trunev2020-05-03 17:53:45
JavaScript
Mikhail Trunev, 2020-05-03 17:53:45

Why doesn't execcommand work?

execCommand doesn't work. I can't figure out why the text isn't getting bold. Maybe I'm doing something wrong. The code itself:

<span onclick="document.execCommand('bold', false, false);">h1111</span>
<div class="_3t4g5rwe34t3" contenteditable></div>

Link to example: https://jsfiddle.net/nge37Lw1/

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question