My HTML Flashcards
(50 cards)
What does HTTP stands for?
Hyper Text Transfer Protocol
How to open links in new tabs.
With the target=_blank attribute.
e.g.:
<a href:”www.xyz.de” target=_blank>xyz</a>
How to parse all HTML before executing java scripts?
defer (
This Boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has been parsed
What does the async attribute do?
The async attribute loads and executes the script asynchronously with the rest of the webpage.
Similar to the defer attribute, the HTML parser will continue parsing the rest of the HTML as the script is downloaded in the background.
However, with the async attribute, the script will not wait until the entire page is parsed: it will execute immediately after it has been downloaded.
Short for writing an ul with a class of “nav” with 3 li’s with class “item” and ankers with class “links?
ul.nav>(li.item>a.links)*3
Which attribute can you use to indicate the current state of a collapsible element on the page?
The aria-expanded attribute:
- When aria-expanded=”true”, it means the content is visible.
- When aria-expanded=”false”, it means the content is hidden.
What tag is used to create a form in HTML?
<form>
How do you specify a text input field in an HTML form?
<input type="text" id="someId" name="someName">
Which attribute is used for password fields in a form?
type=”password”
What element is used to group radio buttons in a form?
<fieldset>
What tag is used to label a group of related form elements within a <fieldset>?
<legend>
How do you create a radio button in an HTML form?
<input type="radio" id="someId" name="someName" value="someValue">
Which HTML attribute should be used to label form controls for better accessibility?
for in <label> tags, linking to the id of the input element.</label>
How do you create a multi-line text input in an HTML form?
<textarea id="someId" name="someName" rows="5" cols="33"></textarea>
What type of input should you use for collecting email addresses?
<input type="email" id="someId" name="someName">
What is the purpose of the name attribute in form elements?
To specify the name of the form data variable that will be sent to the server.
How do you add a submit button to an HTML form?
<input type="submit" value="Send Request">
What is the correct syntax for a self-closing input tag in HTML?
<input type="text" id="someId" name="someName">
How can you group and label related input elements in a form?
Using the <fieldset> and <legend> tags
Which tag is used to create labels for form elements?
<label>
How do you create a form field for user addresses in an HTML form?
<textarea id="addr" name="addr" rows="5" cols="33"></textarea>
How does the ‘type’ attribute help in form validation?
It specifies the type of data that must be entered, such as a number, an email address, or another specific preset type.
How can you use the ‘pattern’ attribute for form validation with an example?
Example:
~~~
<input id=”choose” name=”i-like” required pattern=”[Bb]anana|[Cc]herry”
~~~
allows only “banana”, “Banana”, “cherry”, or “Cherry” as valid inputs.
What API in JavaScript provides methods and properties for form validation?
The Constraint Validation API.
