Pro Coder Quiz

CapDev Harbinger Group

ProCoder Quiz of the Month - June 2023

Top 3 Winners:
Radhika Pathak, Pratiksha Jamdhade, Tejas Argade

Congratulations!!

Quiz Questions and answers are below:

1. What is the difference between the <article> and <section> elements in HTML?
   A) <article> is used for independent, self-contained content, while <section> is used for grouping related content.
   B) <article> is used for grouping related content, while <section> is used for independent, self-contained content.
   C) There is no difference; both elements are interchangeable.
   D) <article> is used for primary content, while <section> is used for secondary content.
Correct Answer: Option A

2. What is the purpose of the role attribute in HTML?
   A) It defines the type of media associated with an element, such as an image or video.
   B) It specifies the language of the content within an element.
   C) It provides additional information or hints about the element's purpose or structure.
   D) It determines the styling or appearance of an element.
Correct Answer: Option C

3. What is the difference between the CSS properties display: none; and visibility: hidden;?
   A) There is no difference; both properties hide the element.
   B) display: none; hides the element and removes it from the document flow, while visibility: hidden; hides the element
but maintains its position in the document flow.
   C) display: none; hides the element but maintains its position in the document flow, while visibility: hidden; hides the
element and removes it from the document flow.
   D) display: none; only hides the element's content, while visibility: hidden; hides the entire element.
Correct Answer: Option B

4. Which of the following CSS selectors has the highest specificity?
   A) Class selector (e.g., .my-class)
   B) Tag selector (e.g., div)
   C) ID selector (e.g., #my-id) 
   D) Universal selector (*)
Correct Answer: Option C

5. Which of the following CSS selectors is more specific?
   A) .container .item
   B) #container .item
   C) .container.item
   D) #container.item
Correct Answer: Option D

6. What keyword is used to check whether a given property is valid or not?
   A) in
   B) is in
   C) exists
   D) lies
Correct Answer: Option A

7. What will be the output of the following code snippet?
function test(...args)
{
console.log(typeof args);
}
test(12);
   A) NaN
   B) Number
   C) Object
   D) Array
Correct Answer: Option C

8. What will be the output of the following code snippet?
function compare()
{
int sanfoundry=1;
char javascript=1;
if(sanfoundry.tostring()===javascript)
return true;
else
return false;
}
   A) runtime error
   B) logical error
   C) true
   D) false
Correct Answer: Option C

9. Which attribute is used to make non focusable element focusable in HTML?
   A. tabindex
   B. focus
   C. tab
   D. None of the above
Correct Answer: Option A

10. Correct way to send mail in HTML is -
   A. <a href = "xy@y">
   B. <a href = "mailto: xy@y">
   C. <mail xy@y</mail>
   D. None of the above
Correct Answer: Option B

11. Which of the following tag is used to create a combo box?
   A. <ul>
   B. <input type = "dropdown">
   C. <list>
   D. <select>
Correct Answer: Option D

12. Which HTML tag is used to display the text with scrolling effect?
   A. <scroll>
   B. <marquee>
   C. <div>
   D. None of the above
Correct Answer: Option B

13. Appropriate value for the overflow element is?
   A. scroll
   B. hidden
   C. auto
   D. all the above
Correct Answer: Option D

14. Which of the following CSS selector is used to specify a rule to bind a particular unique element?
   A. class
   B. id
   C. tag
   D. both class and id
Correct Answer: Option B

15. Which tag is used to embed css in html page?
   A. <!DOCTYPE html>
   B. <script>
   C. <style>
   D. <css>
Correct Answer: Option C


Last modified: Monday, 3 July 2023, 4:14 PM