Why is the cursor positioned on the right side rather than the left side?
$('.legoact').focus();
When the cursor is positioned on the right side, it can be achieved using the following CSS properties:
.lego{
background:#ddd;
width:70%;
margin:14px;
position:relative;
}
.mark{
position:absolute;
right:-9px; top:-9px;
width:14px; height:14px;
border:2px solid white;
border-radius:50%;
background:red;
cursor:pointer;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js">
</script>
<div class='lego legotxt legoact' contenteditable='true'>
<div class='mark' id='mark' contenteditable='false'></div>
</div>