In the text box, change the direction of the current line from "rtl" to "ltr"

I have a text area with a direction from right to left

#myTextarea
{
    direction: rtl; 
}

in the event, with jquery, I change direction from left to right:

$('#myTextarea').css('direction', 'ltr');

this moves the entire contents of the text area from right to left.

I want to move only the current line and leave the previous lines in their default direction.

Is there any way to achieve this?

+5
source share
2 answers

This is not possible, the direction of the text can be applied only to the entire element textarea, and not to its lines.

+3
source

You can try inserting characters '\u202E'at the beginning of a line that changes direction.

, , , , , , . , .

Fiddle

+1

All Articles