حساب الاسم المتاح، بلا غموض
تعرّفوا إلى كيفية تحديد المتصفح للاسم الذي يُطلَق على العنصر
حساب الاسم المتاح، بلا غموض درس مجاني في Web Accessibility Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Web Accessibility Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Web Accessibility Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
What Is an Accessible Name?
The accessible name is the short label a screen reader speaks for an element, like Submit for a button or Search for a field.
Why It Matters
If an element has no accessible name, a screen reader announces just its role, like button, leaving users with no idea what it does.
The Browser Computes It
You rarely set the name directly. The browser runs a name computation algorithm over your markup to decide what each element is called.
It Follows an Order
The algorithm checks sources in a fixed priority order and uses the first one it finds. Knowing that order lets you predict the result.
aria-labelledby Wins First
The highest priority is aria-labelledby. If present, it overrides every other source, gathering text from the elements it points to.
<button aria-labelledby="t">x</button>
<span id="t">Close menu</span>aria-label Comes Next
If there is no labelledby, the browser uses aria-label, a string you type directly on the element as its spoken name.
<button aria-label="Close">x</button>Then Native Labeling
Next come native sources, like a label tied to an input, or the alt text of an image. Use these whenever you can.
<label for="email">Email</label>
<input id="email">Then the Content Itself
For many elements the name falls back to their text content. A button reading Save is named Save without any extra attribute.
<button>Save</button>title Is the Last Resort
The lowest priority source is the title attribute. It only names an element when nothing better exists, and it is easy to miss.
Names Get Trimmed
The computed name is flattened into one string with extra whitespace collapsed, so line breaks and indentation never reach the user.
Name vs Description
The name is what an element is called; a description is extra detail read after it. Today we focus on getting the name right.
Quick Check
An element has both aria-label and inner text. Which becomes its name?
Recap: How Names Are Built
You learned the name computation order: labelledby, then aria-label, then native labels and content, with title last. 🧩
الأسئلة الشائعة
هل درس «حساب الاسم المتاح، بلا غموض» مجاني؟
نعم — نص درس «حساب الاسم المتاح، بلا غموض» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Web Accessibility Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Web Accessibility Academy 4 دروس في المجموع.
ماذا ستتعلم في «حساب الاسم المتاح، بلا غموض»؟
تعرّفوا إلى كيفية تحديد المتصفح للاسم الذي يُطلَق على العنصر تتمرن على Web Accessibility Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Web Accessibility Academy؟
لا تُشترط خبرة سابقة. Web Accessibility Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.
كم من الوقت يستغرق درس «حساب الاسم المتاح، بلا غموض»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Web Accessibility Academy هذا؟
نعم. كل درس في Web Accessibility Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- حساب الاسم المتاح، بلا غموض
- aria-label مقارنةً بـ aria-labelledby
- استخدام aria-describedby لإضافة سياق
- أخطاء التسمية الشائعة التي تُسكت عناصر التحكم