- On a website, what is the purpose of HTML code? HTML is the standard for describing the structure and presentation of information on the Internet. HTML keywords and tags are used to format and display the content of pages on the web.
- What is the difference between an element and a tag? An HTML 'tag' is just the opening or closing entity, whereas an 'element' also includes its contents.
- Why do we use attributes in HTML elements? Attributes changes the default functionality of an element type.
- Describe the purpose of the head, title, and body HTML elements. The head contains metadata, including the title, style elements, meta tags, external links and scripts. The title is what is displayed in the active browser tab. The body contains all the contents of the HTML document.
- In your browser (Chrome), how do you view the source of a website? One can use the Developer Tools.
- List five different HTML elements and what they are used for. For example,
<p></p>
is a paragraph element, and it is used to represent a paragraph of text. The<h1></h1>
tag is used to signal a major header,<h2></h2>
all the way to h6 also indicate headers. An ordered list is created using<ol></ol>
, and unordered lists by using<ul></ul>
. Elements within the list are marked with<li></li>
tags. - What are empty elements? Elements without content between tags, such as the hr tag.
- What is semantic markup? The use of HTML to reinforce semantics, such as making text look bold or italicized.
- What are three new semantic elements introduced in HTML 5? Use page 431 in the book to find more about these new elements.
The
nav
,aside
andarticle
elements.
- There are three main types of lists in HTML: ordered, unordered, and definition. What are their differences? An ordered list numbers its elements, an unordered list begins with a bullet point (unless specified otherwise), and a definition tabs in the second argument.
- What is the basic structure of an element used to link to another website?
<a href="http://www.google.com">Google</a>
- What attribute should you include in a link to open a new tab when the link is clicked? Add target="_blank" after specifying the url.
- How do you link to a specific part of the same page? You can use the id attribute or anchor tags.
- If you're using an input element in a form, what attribute controls the behavior of that input? The 'type' attribute.
- What element is used to create a dropdown list?
The
<select>
element, with<option>
elements. - If you're using an input element to send form data to a server, what should the type attribute be set to? 'submit'
- What element is used to group similar form items together?
The
<fieldset>
element.
- In an image element, why is the alt attribute important? If the image does not appear for some reason, the alt text is displayed.
- What determines if an image element is inline or block? It matters whether the img element is placed inside or outside of a block element.
- What are the benefits of jpg or png image file formats? JPG images lose image wuality and information each time they are saved, resulting in an almost always smaller file size than a PNG.
- What is the benefit of specifying the height and width of images in CSS compared to specifying in the HTML? It's important to keep styles seperated from the HTML to not clutter the HTML and enable yourself to modify styles in one place.
- What is an image sprite, and why is it useful? An image sprite groups different images together, and is especially useful for displaying controls for, for instance, games.
- There are three big data types in JavaScript: numbers, strings, and booleans. Describe what each of them are. Numbers are decimals, strings are pieces of text, and booleans are either true or false.
- What are the three logical operators that JavaScript supports?
They are
&&
(and),||
(or), and!expr
(not). - What is the naming convention used for variables? For variables in JS, one needs to use camelcase.
- What is the difference between an expression and a statement? An expression is assigned to a var, whereas a statement runs inside of a function and returns a value.
- What are a few JavaScript reserved words, and why are they important to avoid using them for variable names? One needs to avoid them because these specific words will always perform teh behavior that is assigned to them, a programmer cannot ovveride their behavior.
- What is control flow, and why is it useful for programming? Control flow is a specific order in which statements, instructions or functions of a program are executed. A programmer needs to understand the order of execution to achieve the correct behavior.
- If we have a function defined as function
sayHello(){console.log("Hello!")}
, what is the difference between enteringsayHello
andsayHello()
in the console? - What is the keyword
return
used for? It returns a value. - What are function parameters? One can pass data into a function, this data needs to be added as a parameter.
- What is the naming convention used for function names? It should be explanatory as to what the function does and should always be camelcase.