Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67411

How to set custom tabindex in html

$
0
0

I have a dynamic html page, and I have a element (div.id=myComponent) in this html, that have three input element inside.

the direction of the body element is rtl and div.id="myComponent" element is ltr.

like this:

<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>

I need it, when the focus enters the div.id="myComponent", like below:

d => m => y

but is reverse.

I use the tabindex attribute, but is not working correctly.

How to fix this problem?

thanks.


Viewing all articles
Browse latest Browse all 67411

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>