
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
10 questions
TMK TAHUN 6
Quiz
•
12th Grade
15 questions
Ulangan Harian 2 Informatika X
Quiz
•
12th Grade
10 questions
Latihan Soal Monitoring
Quiz
•
12th Grade
10 questions
Ce știm despre Internet?
Quiz
•
4th Grade - University
14 questions
Computing figures
Quiz
•
4th - 12th Grade
13 questions
Podsumowanie: binarny, komputer, sieć
Quiz
•
7th Grade - University
10 questions
Keyboarding Terms
Quiz
•
9th - 12th Grade
10 questions
Word basics
Quiz
•
8th - 12th Grade
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