我有一个动态的HTML页面,在这个页面中有一个元素(
我需要它,在
div.id=myComponent
),它包含了三个input
元素。
元素的方向是rtl
,而div.id="myComponent"
元素的方向是ltr
,如下所示:<html>
<body style="direction: rtl;">
<input type="text" /> <!-- I can not set tabindex for this elements. beacuse these are generate the dynamically. -->
...
<!-- any elements -->
<div style="direction: ltr;" id="myComponent">
<span> <input tabindex="3" type="text" placeholder="y" /></span>
<span><input tabindex="2" type="text" placeholder="m" /></span>
<span><input tabindex="1" type="text" placeholder="d" /></span>
</div>
<input type="text" />
...
</body>
</html>
我需要它,在
div.id="myComponent"
中有focus
时,如下所示:
年 => 月 => 日
但是是反向的。
我使用了tabindex
属性,但它没有正确地工作。
你怎么解决这个问题?
谢谢。