HTML Basics
HTML Tags
Frames/iFrame
JavaScript Basics
JS Methods
100

What HTML tag inserts a line break?

<br> 

100

Which HTML5 tag is used to group navigation links?

<nav>

100

What is the main purpose of an iframe?

To embed another webpage inside a webpage.

100

What symbol begins a single-line JavaScript comment?

//

100

Which method writes text to the browser console?

console.log()

200

Which HTML tag is used to create a numbered list?

<ol>

200

Which HTML5 tag is used to define a section of content in a webpage?

<section>


200

Which attributes control the size of an iframe?

width and height

200

What is the output of:

document.write(2 ** 3);


8
200

Which method displays a dialog asking the user to confirm an action?

confirm()

300

Write the HTML tag that creates the largest heading AND the smallest heading.

<h1> and <h6>

300

What tag defines content that is not related to the main content (such as a sidebar)?

<aside>

300

What attribute allows you to specify whether a frame has a border?

frameborder

300

Which keyword declares a variable whose value can change?

let

300

What is the difference between parseInt() and parseFloat()?

  • parseInt() converts a string into a whole number

  • parseFloat() converts a string into a decimal number

400

What is the purpose of the <title> tag?

Sets the title shown in the browser tab.

400

Name an HTML5 multimedia tag OTHER than <audio> or <video>.

<canvas>, <embed>, <iframe>

400

Write an <iframe> tag that loads the page about.html and fills 100% of the width of the webpage.

<iframe src="about.html" width="100%"></iframe>

400

What will be the output of the following code?

let a = 8;
let b = "2";
let c = a / b + a * b;
document.write(c);


Answer:

  • a / b → "2" is converted to number → 8 / 2 = 4

  • a * b → "2" is converted to number → 8 * 2 = 16

  • Total: 4 + 16 = 20

400

What will the following code display?

let num = "12.75";
let result = parseInt(num) + parseFloat(num);
document.write(result);


24.75

500

Explain the difference between <p> and <div>

  • <p> represents a paragraph (semantic)

  • <div> is a non-semantic container for grouping elements

500

Write HTML5 code that plays an audio file named bgmusic.mp3 with controls.

<audio src="bgmusic.mp3" controls></audio>

500

Write an iframe tag that loads home.html with no scrolling.

<iframe src="home.html" scrolling="no"></iframe>

500

What will the following code display?

let a = 3;
let b = 5;
let c = (a > 1 && b < 10) || (a == 5 && b == 3);
document.write(c);


true

  • (a > 1 && b < 10) → 3 > 1 is true, and 5 < 10 is true, so this whole part is true

  • (a == 5 && b == 3) → both are false, so this part is false

Final expression:
true || false → true

500

What will the following code output? 

let value = "10abc";
let a = parseInt(value);
let b = parseFloat(value) * 2;
document.write(a + b);


  • parseInt("10abc") → reads the number until the letters → 10

  • parseFloat("10abc") → also reads the number until letters → 10

  • b = 10 * 2 → 20

  • a + b = 10 + 20 = 30

 

M
e
n
u