الروابط تنقلك إلى أماكن والأزرار تنفّذ أفعالاً
تعلّم القاعدة التي تحسم معظم الحالات تقريباً.
الروابط تنقلك إلى أماكن والأزرار تنفّذ أفعالاً درس مجاني في Web Accessibility Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Web Accessibility Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Web Accessibility Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
The One Rule
Here is the rule that solves almost every case: a link takes you somewhere, and a button makes something happen right here. 🧭
What a Link Is
A link navigates. Clicking it changes the page or URL, like jumping to another article or a new section.
<a href="/pricing">See pricing</a>What a Button Is
A button performs an action in place: it submits a form, opens a menu, or toggles a setting without leaving the page.
<button type="button">Add to cart</button>Why It Matters
Screen readers announce the role out loud. Users hear link or button, so the right element sets the right expectation before they act.
Different Keys, Different Jobs
This is not just cosmetic. A button fires on Space or Enter, but a link activates only on Enter. The keys follow the role.
The Quick Test
Ask one question: does this control change where I am, or change what is on screen? Navigation means link; action means button.
Open in a New Tab
If a control could sensibly open in a new tab or be bookmarked, it is navigation, so use a real link with an href.
Looks Are Not Roles
Styling does not change meaning. A button can look like a link and a link can look like a button, but the element decides the role.
The Common Mistake
People reach for a styled div or span and bolt on a click handler. It looks fine but has no role and no keyboard support.
<div class="btn" onclick="save()">Save</div>Submitting a Form
To send a form, use a button of type submit. It is an action, not navigation, so a link here would be wrong.
<button type="submit">Sign up</button>Going to Another Page
To send a user to your contact page, use a link. That is pure navigation, and a button would mislead everyone.
<a href="/contact">Contact us</a>Quick Check
You add a control that opens a menu without leaving the page. Which element fits?
Recap
Links go places, buttons do things. Match the element to the intent and you get the right role, the right keys, and happy users. 🎉
الأسئلة الشائعة
هل درس «الروابط تنقلك إلى أماكن والأزرار تنفّذ أفعالاً» مجاني؟
نعم — نص درس «الروابط تنقلك إلى أماكن والأزرار تنفّذ أفعالاً» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 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 يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- الروابط تنقلك إلى أماكن والأزرار تنفّذ أفعالاً
- نص رابط مفهوم خارج السياق
- أزرار توضّح ما تفعله
- النمط المضاد للمرساة التي بلا href