What HTML tag inserts a line break?
<br>
Which HTML5 tag is used to group navigation links?
<nav>
What is the main purpose of an iframe?
To embed another webpage inside a webpage.
What symbol begins a single-line JavaScript comment?
//
Which method writes text to the browser console?
console.log()
Which HTML tag is used to create a numbered list?
<ol>
Which HTML5 tag is used to define a section of content in a webpage?
<section>
Which attributes control the size of an iframe?
width and height
What is the output of:
Which method displays a dialog asking the user to confirm an action?
confirm()
Write the HTML tag that creates the largest heading AND the smallest heading.
<h1> and <h6>
What tag defines content that is not related to the main content (such as a sidebar)?
<aside>
What attribute allows you to specify whether a frame has a border?
frameborder
Which keyword declares a variable whose value can change?
let
What is the difference between parseInt() and parseFloat()?
parseInt() converts a string into a whole number
parseFloat() converts a string into a decimal number
What is the purpose of the <title> tag?
Sets the title shown in the browser tab.
Name an HTML5 multimedia tag OTHER than <audio> or <video>.
<canvas>, <embed>, <iframe>
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>
What will be the output of the following code?
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
What will the following code display?
24.75
Explain the difference between <p> and <div>
<p> represents a paragraph (semantic)
<div> is a non-semantic container for grouping elements
Write HTML5 code that plays an audio file named bgmusic.mp3 with controls.
<audio src="bgmusic.mp3" controls></audio>
Write an iframe tag that loads home.html with no scrolling.
<iframe src="home.html" scrolling="no"></iframe>
What will the following code display?
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
What will the following code output?
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