tabindex
السمة tabindex
أيضًا ترتيب علامات التبويب الدقيق للعناصر. يتحقق ذلك عندما يتم تعيين قيمة السمة إلى عدد موجب من 1 أو أعلى. سيؤدي تعيين tabindex = "1" إلى تركيز لوحة المفاتيح على هذا العنصر أولاً. ثم يمر عبر تسلسل قيم tabindex
المحددة (2 ، 3 ، وما إلى ذلك) ، قبل الانتقال إلى tabindex="0"
الافتراضية و tabindex="0"
. من المهم ملاحظة أنه عند تعيين ترتيب علامة التبويب بهذه الطريقة ، فإنه يتجاوز الترتيب الافتراضي (الذي يستخدم مصدر HTML). قد يؤدي ذلك إلى إرباك المستخدمين الذين يتوقعون بدء التنقل من أعلى الصفحة. قد تكون هذه التقنية ضرورية في بعض الظروف ، ولكن فيما يتعلق بإمكانية الوصول ، يجب توخي الحذر قبل تطبيقها. إليك مثال على ذلك: <div tabindex="1">I get keyboard focus, and I get it first!</div>
<div tabindex="2">I get keyboard focus, and I get it second!</div>
input
البحث وإرسال عناصر تحكم نموذج input
ليكون أول عنصرين في ترتيب الجدولة. إضافة سمة tabindex
مضبوطة على "1" إلى input
البحث ، tabindex
مضبوطة على "2" إلى input
. tabindex
إلى علامة input
البحث.
testString: 'assert($("#search").attr("tabindex"), "Your code should add a tabindex
attribute to the search input
tag.");'
- text: يجب أن تضيف الكود الخاص بك سمة tabindex
إلى علامة input
tabindex
.
testString: 'assert($("#submit").attr("tabindex"), "Your code should add a tabindex
attribute to the submit input
tag.");'
- text: يجب أن تحدد tabindex
سمة tabindex
في علامة input
البحث إلى قيمة 1.
testString: 'assert($("#search").attr("tabindex") == "1", "Your code should set the tabindex
attribute on the search input
tag to a value of 1.");'
- text: يجب أن تحدد tabindex
سمة tabindex
على علامة input
tabindex
إلى قيمة 2.
testString: 'assert($("#submit").attr("tabindex") == "2", "Your code should set the tabindex
attribute on the submit input
tag to a value of 2.");'
```
“There's no Theory of Evolution, just a list of creatures I've allowed to live.”
- Chuck Norris
```“Wise men say forgiveness is divine, but never pay full price for late pizza.”
- TMNT