
JavaScript and HTML Quiz
Authored by Waqqad Rasheed
Computers
12th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you change the source of an image in JavaScript?
document.getElementById("image1").innerHTML = "newImage.jpg";
document.getElementById("image1").src = "newImage.jpg";
document.getElementById("image1").textContent = "newImage.jpg";
document.getElementById("image1").setAttribute("alt", "newImage.jpg");
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which JavaScript property would you use to change the font color of a paragraph?
document.getElementById("p1").style. Font = "red";
document.getElementById("p1").style. color = "red";
document.getElementById("p1").fontColor = "red";
document.getElementById("p1").setTextColor("red");
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following JavaScript code do?
document.getElementById("p1").style.fontSize = "x-large";
Changes the font size of the paragraph with ID "p1" to extra-large.
Makes the text bold.
Changes the font to Arial.
Centers the text in the paragraph.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid variable declaration in JavaScript?
var 1name = "John";
var first-name = "John";
var firstName = "John";
var first name = "John";
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following JavaScript code output?
var age = "20"; var newAge = Number(age); alert(newAge);
"20"
NaN
20
undefined
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to convert a boolean value to a number in JavaScript?
var num = Boolean(1);
var num = String(true);
var num = Number(true);
var num = Convert.toBoolean(1);
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is NOT a valid data type in JavaScript?
String
Boolean
Character
Number
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
15 questions
Learning SQL
Quiz
•
11th - 12th Grade
15 questions
Quis Grade 5
Quiz
•
9th - 12th Grade
10 questions
Post-Test Sistem Operasi Perangkat Bergerak
Quiz
•
12th Grade
10 questions
Fundamentals of Computing - Unit 5 Quiz 1 Review
Quiz
•
12th Grade
10 questions
JSPS Competition Hackathon - HTML Language Grade 4 & 5
Quiz
•
4th Grade - University
10 questions
Review Quiz #2- Productivity Tools
Quiz
•
11th - 12th Grade
10 questions
1ª Recuperação - 3° Trim. - Pensamento Computacional - 9º ano
Quiz
•
9th Grade - University
13 questions
Principles of Programming
Quiz
•
KG - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade