The follosing paragraphs show the @dir attribute changed from 'ltr' to 'rtl'. The text in red represents two nested spans. The outer span has the @dir attribute set. The inner span is unecessary for the bidirectional algorithm as it simply reinforces the level of embedding already implied by the change in script from Latin to Arabic.

dir='ltr'

Here's an example of how bidirectional text can be effected by the @dir attribute: ما هي الشفرة الموحدة "يونِكود" ؟ in Arabic. As you can see, the example and this span are effected by the @dir attribute (ltr).

dir='rtl'

Here's an example of how bidirectional text can be effected by the @dir attribute: ما هي الشفرة الموحدة "يونِكود" ؟ in Arabic. As you can see, the example and this span are effected by the @dir attribute (rtl).