Back to dashboard

Reading mode

Unit 3: Programming Fundamentals

Correct answer is shown on each question. Use Next to read one by one.

Question 1 of 20 0% read

1. Grace is learning about CSS selectors. She wants to apply a style only to an element with id 'main-header'. Which CSS selector should she use?

A .main-header
B #main-header
C main-header
D *main-header

2. Diana is working with HTML lists. She wants to create a list where each item has a bullet point. Which list type should she use?

A Ordered list
B Unordered list
C Definition list
D Nested list

3. Iman is creating a webpage with a list of items. She wants the list to be numbered. Which HTML tag should Iman use to create an ordered list?

A <ul>
B <ol>
C <li>
D <dl>

4. Which HTML attribute is used to define inline styles in a single element?

A style
B class
C styles
D font

5. Which HTML tag is used to create a form?

A <input>
B <form>
C <table>
D <div>

6. In JavaScript, which statement is used to declare a variable?

A var
B let
C const
D All of the above

7. What is the correct HTML for referring to an external script called 'script.js'?

A <script href='script.js'>
B <script name='script.js'>
C <script src='script.js'>
D <javascript src='script.js'>

8. Lara is learning about CSS box model. She wants to know the space between the element and other elements. Which part of the box model is that?

A Padding
B Border
C Margin
D Content

9. Usman is learning about JavaScript events. He wants to run a function when a user clicks a button. Which event should he use?

A onmouseover
B onchange
C onclick
D onload

10. Priya is working on a website and wants to change the color of all links when the mouse hovers over them. Which CSS pseudo-class should she use?

A :link
B :visited
C :hover
D :active

11. Which language is mainly used to create web pages?

A Python
B C++
C HTML
D Java

12. Which JavaScript statement is used for decision making?

A for
B while
C if
D switch

13. Where in an HTML document is the correct place to refer to an external style sheet?

A In the <body> section
B In the <head> section
C At the end of the document
D In the <footer> section

14. Hina is writing JavaScript. She wants to convert a string '123' into a number. Which function should she use?

A Number('123')
B parseInt('123')
C parseFloat('123')
D All of the above

15. What type of error occurs when a program runs without crashing but does not produce the expected or correct result?

A Syntax Error
B Runtime Error
C Compile-time Error
D Logical Error

16. Which symbol is used to select an id in CSS?

A .
B *
C #
D $

17. Aisha is creating a link that opens in a new tab. She knows she needs to add an attribute to the <a> tag. Which attribute should she use?

A target="_blank"
B target="_new"
C newtab="true"
D open="new"

18. Nora is building a website. She wants to add a dropdown list of countries. Which HTML element should she use?

A <select>
B <dropdown>
C <list>
D <input type="dropdown">

19. Kofi is creating a table. He wants a cell to span two columns. Which attribute should he use?

A rowspan="2"
B colspan="2"
C span="2"
D merge="2"

20. How do you select an element with the id 'header' in CSS?

A .header
B *header
C header
D #header

You finished reading all questions

Try practice mode to check answers without scoring, or play for a scored attempt.