I have the following code which allows me to select a div text each time the user click on it:
<table>
<tr>
<td>
<div contenteditable onClick="document.execCommand('selectAll',false,null)">I'm editable</div>
</td>
</tr>
<tr>
<td>
<div contenteditable>I'm also editable</div>
</td>
</tr>
<tr>
<td>I'm not editable</td>
</tr>
</table>
My problem is that document.execCommand
is deprecated and I want to change it for a good alternative. How can I do that?