1. <!doctype html>
2. <body>
3. <html>
4. <head>
If we want to target a class with a CSS selector, the selector will have to start with this character.
. <-- a period
What HTML element/tag do we put JavaScript code in?
<script>JAVASCRIPT</script>
What does DOM stand for?
Document Object Model
Where should a <link> element used to include a CSS file go?
1. Before the <head> element
2. Inside the <head> element
3. Inside the <body> element
4. After the<body> element
2. Inside the <head> element
Name a character that is NOT allowed in a JavaScript variable name
spaces, hyphens
What function/method is used to select an element by id or a class
querySelector
1. <a href="http://www.google.com">Google</a>
2. <a src="http://www.google.com">Google</a>
3. <a name="Google">http://www.google.com</a>
4. <link href="http://www.google.com">Google</link>
5. <link src="http://www.google.com">Google</link>
6. <link name="Google">http://www.google.com</link>
1. <a href="http://www.google.com">Google</a>
Fill in the blanks. In the following CSS rule, "img" is a __________, "width" is a __________, and "100px" is a __________.
Choose between(value, selector, and property)
img { width: 100px; }
(1) selector (2) property (3) value
Rewrite the following element so it has the class "largeImages" and src is "someImage.jpg"
<img src="someImage.jpg">
<img class="largeImages" src="someImage.jpg">
Print the length of an array called "someArray"
console.log(someArray.length)
What property is used to get/set an element's HTML content
1. <img href="image.gif" alt="MyImage">
2. <image src="image.gif" alt="MyImage">
3. <img alt="MyImage">image.gif</img>
4. <img src="image.gif" alt="MyImage">
4. <img src="image.gif" alt="MyImage">
Given the following HTML, write a CSS rule that targets ONLY the second image and sets its width property to 200px.
<img class="largeImages" src="pic1.jpg">
<img class="largeImages" id="second" src="pic2.jpg">
<img id="third" src="pic3.jpg">
#second { width: 200px; }
Rewrite the following element so it has the ID "favClub"
<h1>ScriptEd</h1>
<h1 id="favClub">ScriptEd</h1>
What function/method attaches an event handler to an element?
.addEventListener()
1. <a>http://www.w3schools.com</a>
2. <a name="http://www.w3schools.com">W3Schools.com</a>
3. <a href="http://www.w3schools.com">W3Schools</a>
4. <a url="http://www.w3schools.com">W3Schools.com</a>
What's wrong with the following CSS rule?
p ( color - blue )
1.Uses parentheses instead of curly-braces.
2. Uses "-" instead of ":" between color and blue.
3. No semi-colon after blue.
Which of the following attributes does NOT go in the <link> element?
1. src
2. href
3. type
4. rel
1. src
Create a for loop that prints 1 -10.
for (i=1; i<11; i++) {
console.log(i)
}
What method to use to add a class, "flip" to an element, called card
card.classList.add('flip')