I have fixed width div with a long text inside. How can I get lines of a text which are the result of word wrapping?
In the attached snippet I want to get an array with two strings: ['Lorem Ipsum. Lorem Ipsum.', 'Lorem Ipsum.']
.
console.log(document.getElementById('target').innerText)
<div id="target" style="width: 200px">Lorem Ipsum. Lorem Ipsum. Lorem Ipsum.</div>