Looking for assistance with changing text direction on each new line. For instance:
text left-to-right
text right-to-left
text left-to-right
text right-to-left... etc.
I would like the text direction to change with each word-wrap: break-word
. Any help would be appreciated, whether it's through jQuery or JavaScript.
Below is an example using CSS and paragraphs. However, I need to change the text direction without using paragraphs, or within the confines of a single paragraph with word-wrapping.
Unfortunately, I'm at a loss on how to achieve this...
.ltr {
direction: ltr;
}
.rtl {
direction: rtl;
}
<p class="ltr">Some text ltr</p>
<p class="rtl">ltr txet emoS</p>
<p class="ltr">Some text ltr</p>
<p class="rtl">ltr txet emoS</p>
<p class="ltr">Some text ltr</p>
<p class="rtl">ltr txet emoS</p>