JavaScript and CSS Basics Quiz
Quiz
•
Computers
•
9th Grade
•
Medium
R Eveleigh
Used 3+ times
FREE Resource
Enhance your content
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to define a function in JavaScript?
function = myFunction() {}
function myFunction() {}
def myFunction() {}
function: myFunction() {}
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the `getElementById` method do in JavaScript?
It selects all elements with a specific class name.
It selects the first element with a specific tag name.
It selects the element with a specific id.
It creates a new element with a given id.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you change the content of an HTML element with the id "demo" to "Hello, World!" using JavaScript?
document.getElementById("demo").innerHTML = "Hello, World!";
document.getElementById("demo").value = "Hello, World!";
document.getElementById("demo").text = "Hello, World!";
document.getElementById("demo").content = "Hello, World!";
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which symbol is used to select a class in CSS?
#
.
$
@
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you select an element with the id "main" in CSS?
.main
#main
main
*main
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to add a click event handler to a button with the id "myBtn" in JavaScript?
document.getElementById("myBtn").onclick = myFunction;
document.getElementById("myBtn").onClick(myFunction);
document.getElementById("myBtn").addEvent("click", myFunction);
document.getElementById("myBtn").click = myFunction();
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax to select all elements with the class "highlight" in CSS?
#highlight
.highlight
highlight
*highlight
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple

Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
Microsoft Word QCM 1
Quiz
•
5th - 12th Grade
12 questions
HTML & CSS Part II
Quiz
•
9th - 12th Grade
15 questions
Adobe TEST Study 1
Quiz
•
9th - 12th Grade
10 questions
HTML Basics
Quiz
•
7th - 10th Grade
15 questions
2023 - Web Design - CSS Review
Quiz
•
9th - 12th Grade
11 questions
Ice breaker 2
Quiz
•
9th - 12th Grade
8 questions
What is CSS? And How It Works! YouTube Video Quiz
Quiz
•
9th - 12th Grade
14 questions
HTML i CSS
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
30 questions
Computer Terminology Exercise #1 ( Fill Ins)
Quiz
•
9th Grade
15 questions
MLA Formatting
Quiz
•
9th Grade
20 questions
Typing Practice
Quiz
•
7th - 12th Grade
14 questions
Inputs and Outputs: Computer Science Intro
Lesson
•
5th - 9th Grade
20 questions
Google Sheets Quiz
Quiz
•
9th Grade