document.querySelector is used to...
link JS variables to HTML elements.
In JavaScript, this is like a box/container that stores pieces of information.
What is a variable?
Why is it important to assign classes to HTML elements?
So that you can edit each class specifically.
These CSS properties define the space between the element border and the element content.
What is padding?
Can JavaScript alter the style of a page?
Yes, it can reference CSS to change styling elements of a webpage when event (i.e. clicking) is initiated.
In the code below, I want to change the data type from a number to a string. What changes need to be made?
let daysInweek= 7;
let daysInweek= "7";
This is a series of characters or texts. The information can be assigned to a variable.
What is a string?
What is the role of the <br> tag?
Add breaks in the page to separate HTML elements.
Can a website function without CSS?
Yes,it can. Without CSS, websites would be less pleasing to the eye and likely much harder to navigate
The code below has three errors. What are the three errors?
let name = Documentqueryselector(".yourName").value;
let name = document.querySelector(".yourName").value;
document should be lowercase
Period after document
Selector should be capital
What does it equal?
let first = "Kevin ";
let space = " ";
let last = "Hart ";
first + space + last =
Kevin Hart
If I want to add a flex-box what language would I use?
CSS
What's the difference between a placeholder and a class?
Placeholder: gives user a hint
Class: classify different tags
In CSS, when changing the style of the body, do we add a dot before body.
Ex: .body
No, we do not need to classify body.
What is the purpose of declaring variables in JS?
Its a bridge between JS and HTML elements. The variables represent an HTML element that can now be edited in JS.
To add an image to a website, what link would be complete this function.
image address
What is the role of JavaScript?
Add interactivity on webpage.
What is the purpose of a 'placeholder'?
To give the user a hint as to what to type in the input field.
The CSS code below contains two errors. What are the two errors?
.results {
width 400px;
padding: 10px;
margin: 50;
}
width:
50px;
What is the purpose of .value?
To return the value that user enters into input field.
Explain the purpose of an input field?
Allows user to enter information.
Strings are always surrounded by this punctuation. Name the two types of punctuation.
double quotation marks" OR 'single quotation marks'
If i want to group elements in HTML together how would i do that?
Surround elements with the same 'div' tag and class name.
Explain how you create a flex-box.
(note: must use the word 'div tag' in your response.)
You create a div tag with a class name that surrounds what you want to edit in HTML. Then you use display: flex; in CSS.
Explain the purpose of the following code:
submitButton.onclick=function(){
let userInput=document.querySelector("input").value;
when the button is clicked it connects the variable userInput to whatever value is entered within the input field.