Mystery Box
Languages
Html
CSS
JavaScript
100

document.querySelector is used to...

link JS variables to HTML elements.

100

In JavaScript, this is like a box/container that stores pieces of information.

What is a variable?

100

Why is it important to assign classes to HTML elements?

So that you can edit each class specifically.

100

These CSS properties define the space between the element border and the element content.

What is padding?

100

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.

200

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";

200

This is a series of characters or texts. The information can be assigned to a variable.

What is a string?

200

What is the role of the <br> tag?

Add breaks in the page to separate HTML elements.

200

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 

200

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 

300

What does it equal?

let first = "Kevin ";

let space = " ";

let last = "Hart ";

first + space + last =

Kevin Hart 

300

If I want to add a flex-box what language would I use? 

CSS

300

What's the difference between a placeholder and a class?

Placeholder: gives user a hint  

Class: classify different tags  


300

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. 

300

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.

400

To add an image to a website, what link would be complete this function.

image address 

400

What is the role of JavaScript?

Add interactivity on webpage.

400

What is the purpose of a 'placeholder'?

To give the user a hint as to what to type in the input field.

400

The CSS code below contains two errors. What are the two errors?

.results {

    width 400px;

    padding: 10px;

    margin: 50;

}

width: 

50px;

400

What is the purpose of .value?

To return the value that user enters into input field.

500

Explain the purpose of an input field?

Allows user to enter information.

500

Strings are always surrounded by this punctuation. Name the two types of punctuation.  

double quotation marks" OR 'single quotation marks'

500

If i want to group elements in HTML together how would i do that?

Surround elements with the same 'div' tag and class name.

500

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.

500

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.