Course Recommendation:

KeyboardEvent altKey Property

Definition and Usage

On some Mac keyboards, "ALT" key is displayed as "Option" or "Opt".The altKey property returns a boolean value indicating whether the "ALT" key is pressed during a keyboard event.

On some Mac keyboards, "ALT" key is displayed as "Option" or "Opt".Note:

This property is read-only.

Example

Determine whether the "ALT" key is pressed when clicking the keyboard key:
var x = document.getElementById("demo");
  if (event.altKey) {
x.innerHTML = "The ALT key was pressed!";
  }
x.innerHTML = "The ALT key was NOT pressed!";

}

လက်တွေ့ ကြိုးစားပါ

event.altKey

နည်းပညာ အချက်အလက်

နိုင်ငံခြား အသုံးပြု ပြီး နောက် သုံးစွဲသည့် ပစ္စည်း

အယ်လ်တီ အမှား ချဲ့ခြင်း ကို သုံးစွဲသည့် ကစ်နော်ဒီ အခင်းအမျိုးအစား အား ကြည့်ရှုသည့် အကယ်။

အခြား ကိန်းသား များ

  • true - အယ်လ်တီ ချဲ့ခြင်း ရှိ
  • false - အယ်လ်တီ အမှား ချဲ့ခြင်း မရှိ
DOM ပုံစံ DOM Level 2 Events

ဘဏ္ဍာကြောင်း ကူညီ

ဗဟိုက္ခဏာ ချီလက် အိင် ဖိုးန်း ဆေးဖ် အိုပရက်ရာ
altKey ကူညီ ကူညီ ကူညီ ကူညီ ကူညီ

ပတ်သတ်ထားသော စာမျက်နှာ

HTML DOM ကိုးကားချက်KeyboardEvent ctrlKey ဗဟိုက္ခဏာ

HTML DOM ကိုးကားချက်KeyboardEvent metaKey ဗဟိုက္ခဏာ

HTML DOM ကိုးကားချက်KeyboardEvent shiftKey ဗဟိုက္ခဏာ