HTML Questions and Answers Part-17

1. WAVE PCM is not supported by _________
a) Chrome
b) Firefox
c) Safari
d) Internet Explorer

Answer: a
Explanation: WAVE format is usually supported by Firefox, Internet Explorer and Safari. The files end with the extension “.wav”. MIME type for audio is audio/wave or audio/x-wav or audio/wav or audio/ x-pn-wav.

2. Flac is supported by ___________
a) Firefox
b) Chrome
c) Safari
d) Internet Explorer

Answer: a
Explanation: Flac audio format is supported by mobile Gecko 58.0 (Thunderbird 58.0/ Firefox 58.0/ SeaMonkey 2.55) and desktop Gecko Firefox 51.0 (Thunderbird 51.0/ Firefox 51.0/ SeaMonkey 2.48). Extension for the FLAC format is “.flac”. MIME type is audio/ flac or audio/ x-flac.

3. Which of the following is not a Boolean attribute for <audio> element?
a) autoplay
b) loop
c) muted
d) buffered

Answer: d
Explanation: Autoplay is a Boolean attribute and its default value is set as false. Basically, this feature of autoplay is avoided due to the unpleasant experience of users. Loop is also a Boolean attribute. Muted is Boolean attribute whose value is set as false by default. Buffered is not boolean attribute in <audio> element.

4. What can not be done by controls attribute?
a) playback
b) resume playback
c) pause playback
d) looping

Answer: d
Explanation: Controls attribute of <audio> element provides a user the facility of playback with volume, seeking, pause, resume playback. Looping can be done with loop attribute which is a Boolean attribute. It automatically seeks back to start when audio reaches to end.

5. Which browser supports mozCurrentSampleOffset?
a) Chrome
b) Internet Explorer
c) Opera
d) Firefox

Answer: d
Explanation: mozCurrentSampleOffset attribute is not supported by Chrome, Edge, Internet Explorer, Opera or Safari. It is only supported by Firefox. This is an offset which specifies the number of samples from the beginning of audio to the place where audio is currently playing.

6. What is the default type of ‘type’ attribute of <input> element?
a) Text
b) Password
c) Numerals
d) Special Characters

Answer: a
Explanation: Text input type defines single line text field. Type is the attribute that displays type of <input> elements. Its default type is text. It is supported by most of the browsers like Chrome, Internet Explorer, Firefox, Opera. Syntax is: <form action=”jump.php”> Name:<input type=”text” name=”name”> </form> A password field is defined by password input.

7. Which of the following is a new input attribute introduce by HTML5?
a) text
b) checkbox controls
c) submit buttons
d) date

Answer: d
Explanation: HTML4 has attributes with <input> elements like radio buttons, Checkbox controls, submit buttons, text input etc.
HTML5 has introduced new attributes like date, color, month, time, week, datetime-local, email, number, range, tel, url, search etc.

8. How does the color attribute work?
a) Changes color of the text
b) Changes background color
c) The color picker is defined by it
d) Changes color of the text as well as background

Answer: c
Explanation: color is the attribute of <input> element introduce by HTML5. It defines the color picker i.e we can select a color of our choice from the color picker. Syntax is Select the color that you want: <input type=”color” name=”favorite color”>

9. Which attribute is used for activation of JavaScript?
a) button
b) checkbox
c) url
d) submit

Answer: a
Explanation: Input type button is used for the activation of JavaScript on the clicking of the button. Its syntax is <input type=”button” value=”click” onclick=”source()”>. This will display a button named click and when we click that button JavaScript function source() will be invoked.

10. Which attribute defines the file-select field?
a) file
b) checkbox
c) button
d) text

Answer: a
Explanation: file input type defines a file-select field, also gives a “Browse” button for file uploads. Syntax is <input type=”file” name=”image”>. Checkbox gives the facility to select one or more than one options from the given choices. The button activates JavaScript code. The text defines a single-line text field.