HTML MCQs

18 MCQs  — Web Development MCQs  (Page 2 of 2)

Which elements were removed from HTML5 as purely presentational?
<strong> and <em>
<table> and <tr>
<div> and <span>
<font> and <center>
How should custom data be stored on an HTML element for use by JavaScript?
With data-* attributes, such as data-station-id="42", read through element.dataset.stationId
In the class name only
With any made-up attribute, such as station="42"
Inside HTML comments
What is the difference between <canvas> and <svg>?
They are the same
<svg> is a bitmap
<canvas> is a bitmap drawn with JavaScript (no DOM for its shapes); <svg> is vector graphics with each shape in the DOM
<canvas> scales without losing quality
How is an HTML comment written?
# comment
// comment
<!-- comment -->
/* comment */
What does the sandbox attribute on an <iframe> do?
It speeds up the iframe
It makes the iframe invisible
It applies extra restrictions to the framed content (such as blocking scripts and forms) unless specific permissions are added
It allows the iframe full access to the parent page