Shared Flashcard Set

Details

HTML Q-A Set 2
W3 Schools HTML Tutorial
87
Computer Science
Professional
12/21/2020

Additional Computer Science Flashcards

 


 

Cards

Term
The content for <kbd>, <samp>, and <code> are all displayed by default in what font?
Definition
The browser's default monospace font
Term
The HTML _____ element is used to define sample output from a computer program.
Definition
<samp>
Term
The HTML _____ element  is used to define a piece of computer code.
Definition
<code>
Term
By default, the <code> element does not preserve extra white space and line-breaks. How can you change that?
Definition
You can put the <code> element inside a <pre> element.
Term
What is a 'semantic element'?
Definition
A semantic element clearly describes its meaning to both the browser and the developer.
Term
Give three examples of semantic elements and two examples of non-semantic elements.
Definition
Semantic elements: <form>, <table>, and <article>
Non-semantic elements: <div> and <span>
Term
The _____ element defines a section in a document.
Definition
<section>
Term
Similar to <section>, the _____ element groups paragraphs and other content into self-contained "part".
Definition
<article>
Term
The _____ element represents a container for introductory content or a set of navigational links.
Definition
<header>
Term
A <header> element typically contains what three components?
Definition
a. one or more heading elements (<h1> - <h6>)
b. logo or icon
c. authorship information
Term
The _____ element defines a set of navigation links.
Definition
<nav>
Term
By default, the <nav> element displays links (vertically/horizontally).
Definition
Horizontally
Term
The _____ tag specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.
Definition
<figure>
Term
The _____ tag defines text that should be marked or highlighted.
Definition
<mark>
Term
Reserved characters in HTML must be replaced with _____, or else the browser might mix them with tags.
Definition
character entities
Term
The _____ character set covers almost all of the characters and symbols in the world.
Definition
UTF-8
Term
You specify the HTML page's character set in the _____ section.
Definition
<meta>
Term
The HTML _____ element is used to create an HTML form for user input.
Definition
<form>
Term
The <form> element is actually a container for different types of input elements, such as what?
Definition
Text fields, check boxes, radio buttons, submit buttons, etc.
Term
The for attribute of the _____ tag should be equal to the id attribute of the _____ element to bind them together.
Definition
<label>; <input>
Term
A _____ lets a user select ONE of a limited number of choices.
Definition
radio button
Term
What HTML code would you write to define a button for submitting the form data to a form-handler?
Definition
<input type="submit">
Term
Where do you specify form handlers for processing user input?
Definition
A form-handler is specified in a form element's action attribute.
Term
Notice that each input field must have a _____ attribute to be submitted.
Definition
name
Term
The _____ attribute defines the action to be performed when the form is submitted.
Definition
action
Term
What is the purpose of the target attribute for the <form> tag?
Definition
The target attribute specifies where to display the response that is received after submitting the form.
Term
What are the five values a form's target attribute can have?
Definition
_blank
_self
_parent
_top
(frame name)
Term
If you set a form's target attribute to "_blank", what happens when the user clicks the submit button?
Definition
The response is displayed in a new window or tab.
Term
If you set a form's target attribute to "_self", what happens when the user clicks the submit button?
Definition
The response is displayed in the current window
Term
If you set a form's target attribute to "_parent", what happens when the user clicks the submit button?
Definition
The response is displayed in the parent frame.
Term
If you set a form's target attribute to "_top", what happens when the user clicks the submit button?
Definition
The response is displayed in the full body of the window.
Term
If you set a form's target attribute to (frame name), what happens when the user clicks the submit button?
Definition
The response is displayed in a named iframe.
Term
What is the purpose of a form's method attribute?
Definition
The method attribute specifies the HTTP method to be used when submitting the form data.
Term
What are the two method attribute values for form submission?
Definition
a. method="get"
b. method="post"
Term
Why is the GET method less secure than POST?
Definition
GET is less secure compared to POST because data is sent as part of the URL. So it's saved in browser history and server logs in plaintext.
Term
Which method does NOT cache form data: GET or POST?
Definition
POST does not cache form data.
Term
When submitting sensitive information, should you use GET or POST?
Definition
The POST method should be used when sending passwords or other sensitive information.
Term
Which form attribute can you set to indicate that the data being submitted does not need to be validated?
Definition
novalidate
Term
What is the purpose of the enctype form attribute?
Definition
Specifies how the form-data should be encoded when submitting it to the server (only for method="POST")
Term
What value is required for the enctype attribute when you are using forms that have a file upload control?
Definition
multipart/form-data
Term
One of the most used form elements is the _____ element.
Definition
<input>
Term
Which HTML element will trigger a user's screen-reader to read the information aloud?
Definition
<label>
Term
Which form element defines a drop-down list?
Definition
<select>
Term
Which HTML element, nested within a <select> tag, provides a list of drop-down choices?
Definition
<option>
Term
Which <select> attribute can you use to limit the number of list choices displayed to a user?
Definition
size
Term
You want to allow users to select multiple items from a <select> list. Which attribute will let you do that?
Definition
multiple
Term
Which two <textarea> attributes are used to set the height and width?
Definition
The rows attribute specifies the visible number of lines in a text area. The cols attribute specifies the visible width of a text area.
Term
You should set the <button> attribute type to what value, and why?
Definition
button - because different browsers may use different default types for the button element.
Term
The _____ element is used to group related data in a form.
Definition
<fieldset>
Term
How do you define a caption for the <fieldset> element?
Definition
The <legend> element.
Term
The _____ element specifies a list of predefined options for an <input> element.
Definition
<datalist>
Term
You use the _____ element to populate the list of <datalist> choices.
Definition
<option>
Term
The characters in a _____ form field are masked, as asterisks or circles, by default.
Definition
password
Term
_____ defines a button for submitting form data to a form-handler.
Definition
<input type="submit">
Term
_____ defines a reset button that will reset all form values to their default values.
Definition
<input type="reset">
Term
What is the main difference between date and datetime-local input attributes?
Definition
The difference between the two is that the datetime-local input does not include the time zone. If the time zone is not important to your application, use datetime-local.
Term
The input _____ attribute specifies the visible width, in characters, of an input field.
Definition
size
Term
The input _____ attribute specifies the maximum number of characters allowed in an input field.
Definition
maxlength
Term
The input _____ attribute specifies that an input field must be filled out before submitting the form.
Definition
required
Term
The input _____ attribute specifies the URL of the file that will process the input when the form is submitted.
Definition
formaction
Term
The input formenctype attribute only works with what HTTP method?
Definition
POST
Term
The input _____ attribute specifies a name or a keyword that indicates where to display the response that is received after submitting the form.
Definition
formtarget
Term
The formtarget attribute works with the following input types: _____ and _____.
Definition
submit and image
Term
The _____ element is only a container for graphics. You must use JavaScript to actually draw the graphics.
Definition
<canvas>
Term
SVG stands for _____.
Definition
Scalable Vector Graphics
Term
SVG defines vector-based graphics in _____ format.
Definition
XML
Term
(Canvast/SVG) has no support for event handlers.
Definition
Canvas
Term
(Canvast/SVG) is well suited for graphic-intensive games.
Definition
Canvas
Term
(Canvast/SVG) is best suited for applications with large rendering areas (Google Maps).
Definition
SVG
Term
(Canvast/SVG) is not suited for game applications.
Definition
SVG
Term
The HTML _____ element is used to show a video on a web page.
Definition
<video>
Term
What would be the code for an embedded video file (MP4) that you want displayed 320 x 240?
Definition
<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>
Term
The _____ attribute adds audio controls, like play, pause, and volume.
Definition
controls
Term
What is the media type for playing MP3 audio in HTML?
Definition
"audio/mpeg"
Term
What would be the code for an embedded audio file (MP3) on your website?
Definition
<audio controls>
  <source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
Term
What is the current state of Java Applets, ActiveX controls, and Flash plug-ins with respect to modern browsers?
Definition
a. Most browsers no longer support Java Applets and Plug-ins.
b. ActiveX controls are no longer supported in any browsers.
c. The support for Shockwave Flash has also been turned off in modern browsers.
Term
The easiest way to play videos in HTML, is to use _____.
Definition
YouTube
Term
What are the five steps for playing a YouTube video on your webpage?
Definition
a. Upload or select a video on YouTube.
b. Take a note of the video id.
c. Define an <iframe> element in your web page.
d. Let the src attribute point to the video URL.
e. Use the width and height attributes to specify the dimension of the player.
Term
What string can you add to the end of a YouTube link so it auto-plays on your webpage?
Definition
"autoplay=1"
Term
What string can you add to the end of a YouTube link so that it loops indefinitely?
Definition
"loop=1"
Term
What string can you add to the end of a YouTube link so that it displays video player controls?
Definition
"controls=1"
Term
With _____, web applications can store data locally within the user's browser.
Definition

web storage

Term
HTML web storage provides two objects for storing data on the client: _____ and _____.
Definition
window.localStorage and window.sessionStorage
Term
Which HTML web storage stores data with no expiration date?
Definition
window.localStorage
Term
Which HTML web storage stores data for one session (data is lost when the browser tab is closed)?
Definition
window.sessionStorage
Term
A web worker is a _____ running in the background, without affecting the performance of the page.
Definition
JavaScript
Term
Server-Sent Events (SSE) allow a web page to do what?
Definition
They allow a web page to get updates from a server.
Supporting users have an ad free experience!