I have this textarea:
<textarea id="ifade" rows="6" cols="66" placeholder="...Start Writing in Arabic"></textarea>
and I have trying to do find character at both normal newline ('\n') and rendered newlines(or if I can insert the '\n' character to rendered newlines but I cannot do that also...)
var remainedPlace;
var inputValue = $("#textarea").val();
for (var j = 0; j < inputValue.length; j++) // from start of the textarea to the end of textarea ...
{
// I cannot detect rendered newlines below..:
for (var k = j; inputValue.charAt(k) != '\r\n' && inputValue.charAt(k) != '\r' && inputValue.charAt(k) != '\n'; k++) // from start of that line to the end of that line ...
{
/* doing some un-important stuff here:
for(var l = 0; l < selections.length; l++) // from selected letters
{
if(inputValue.charAt(k) == selections[l]) // every selected letters
lineSums[line]++; // increment as count in that line
remainedPlace = k;
}
*/
}
line++;
j = ++remainedPlace;
}
I want to find out width-size dynamic line break indexes of line break characters means that when we resize textarea horizontally it should render line breaks again and so our calculated rendered new line break indexes also should change
This textarea has less 2 rendered line-breaks:<br>
<textarea rows="3" cols="66">this text will broke/render new line breaks according to textarea width even though I have never used '\n' in it character, I want to find out that rendered line break indexes created according to textarea width</textarea>
<br><br>This textarea has less 6 rendered line-breaks:<br>
<textarea rows="7" cols="23">this text will broke/render new line breaks according to textarea width even though I have never used '\n' in it character, I want to find out that rendered line break indexes created according to textarea width</textarea>
This ( Find rendered line breaks with javascript ) question seems similar but it is not working for textarea hence I have not enough points I cannot asked in comments and so I have opened this new question.