101. Which HTML attribute provides alternative text for screen readers?
- a) alt
- b) title
- c) aria-label
- d) All of the above
Answer: D - All these attributes help provide accessible text alternatives.
102. Which HTML5 attribute makes an element focusable for keyboard navigation?
- a) focus
- b) tabindex
- c) keyboard-nav
- d) accessible
Answer: B - The tabindex attribute controls keyboard focus order.
103. Which ARIA attribute indicates an element's current state?
- a) aria-state
- b) aria-current
- c) aria-status
- d) aria-live
Answer: B - aria-current indicates the current item in a set.
104. Which HTML element is most semantic for a navigation menu?
- a) <div class="nav">
- b) <nav>
- c) <menu>
- d) <ul class="navigation">
Answer: B - The <nav> element is specifically for navigation links.
105. Which HTML5 feature allows offline web applications?
- a) LocalStorage
- b) Application Cache
- c) Service Workers
- d) Both b and c
Answer: D - Both Application Cache and Service Workers enable offline functionality.
106. Which HTML5 API allows geolocation access?
- a) Navigator.geolocation
- b) Window.location
- c) GeoAPI
- d) HTML5.location
Answer: A - The Geolocation API is accessed through navigator.geolocation.
107. Which HTML5 feature allows web storage?
- a) Cookies
- b) WebSQL
- c) IndexedDB
- d) Both b and c
Answer: D - WebSQL and IndexedDB are HTML5 storage options (though WebSQL is deprecated).
108. Which HTML5 feature allows drag-and-drop functionality?
- a) draggable attribute
- b) Drag and Drop API
- c) Both a and b
- d) jQuery UI
Answer: C - HTML5 provides native drag-and-drop through both the attribute and API.
109. Which HTML5 feature allows web workers?
- a) Background threads
- b) Service workers
- c) WebAssembly
- d) Shared workers
Answer: A - Web workers allow JavaScript to run in background threads.
110. Which HTML5 feature provides 2D drawing capabilities?
- a) SVG
- b) Canvas
- c) WebGL
- d) All of the above
Answer: D - All provide drawing capabilities at different levels.
111. Which HTML5 feature allows real-time communication?
- a) WebSockets
- b) Server-Sent Events
- c) WebRTC
- d) All of the above
Answer: D - All are HTML5 real-time communication technologies.
112. Which HTML5 feature allows web components?
- a) Custom Elements
- b) Shadow DOM
- c) HTML Templates
- d) All of the above
Answer: D - These are all parts of the Web Components standard.
113. Which HTML5 feature allows form validation?
- a) Constraint Validation API
- b) Input types like email/url
- c) pattern attribute
- d) All of the above
Answer: D - HTML5 provides multiple validation methods.
114. Which HTML5 feature allows history manipulation?
- a) History API
- b) location.hash
- c) Both a and b
- d) sessionStorage
Answer: C - Both methods allow history manipulation in different ways.
115. Which HTML5 feature allows fullscreen mode?
- a) Fullscreen API
- b) requestFullscreen()
- c) Both a and b
- d) CSS fullscreen property
Answer: C - The Fullscreen API includes the requestFullscreen() method.
116. Which HTML5 feature allows clipboard access?
- a) Clipboard API
- b) document.execCommand()
- c) Both a and b
- d) navigator.clipboard
Answer: C - Both methods allow clipboard interaction (though execCommand is deprecated).
117. Which HTML5 feature allows device orientation detection?
- a) DeviceOrientationEvent
- b) DeviceMotionEvent
- c) Both a and b
- d) Screen.orientation
Answer: C - Both events provide device orientation/motion data.
118. Which HTML5 feature allows battery status monitoring?
- a) navigator.battery
- b) navigator.getBattery()
- c) window.batteryStatus
- d) Battery Status API
Answer: B - The Battery Status API is accessed via navigator.getBattery().
119. Which HTML5 feature allows vibration control?
- a) navigator.vibrate()
- b) Vibration API
- c) Both a and b
- d) DeviceFeedback API
Answer: C - The Vibration API's primary method is navigator.vibrate().
120. Which HTML5 feature allows push notifications?
- a) Notification API
- b) Push API
- c) Both a and b
- d) Web Alerts
Answer: C - The Notification API displays notifications while the Push API handles server pushes.