JavaScript and CSS Basics Quiz

JavaScript and CSS Basics Quiz

9th Grade

10 Qs

quiz-placeholder

Similar activities

Web Page Design II

Web Page Design II

9th - 12th Grade

15 Qs

Web Page Design CSS Styling Quiz

Web Page Design CSS Styling Quiz

9th - 12th Grade

15 Qs

WEB: Unit 3 Lesson 3 CSS Selectors By Class

WEB: Unit 3 Lesson 3 CSS Selectors By Class

9th - 12th Grade

10 Qs

Pensamento Computacional 9º prova 2

Pensamento Computacional 9º prova 2

9th Grade

8 Qs

HTML/CSS

HTML/CSS

9th Grade

10 Qs

[Hall] Identifying CSS Selectors

[Hall] Identifying CSS Selectors

9th - 12th Grade

10 Qs

App Lab introduction

App Lab introduction

9th Grade

9 Qs

Web Design-Chapter 3

Web Design-Chapter 3

9th - 12th Grade

13 Qs

JavaScript and CSS Basics Quiz

JavaScript and CSS Basics Quiz

Assessment

Quiz

Computers

9th Grade

Medium

Created by

R Eveleigh

Used 3+ times

FREE Resource

AI

Enhance your content

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?