Test 1 - JavaScript

Test 1 - JavaScript

University

50 Qs

quiz-placeholder

Similar activities

Summer Quiz for Senior Class - Quiz Four

Summer Quiz for Senior Class - Quiz Four

11th Grade - University

50 Qs

UJIAN MID SEMESTER 1 XII RPL PEMROGRAMAN WEB DAN PERANGKAT BERGE

UJIAN MID SEMESTER 1 XII RPL PEMROGRAMAN WEB DAN PERANGKAT BERGE

University

50 Qs

RIA Revision for Class Test_Set 2

RIA Revision for Class Test_Set 2

University

50 Qs

Quis Java Gunadarma

Quis Java Gunadarma

University

45 Qs

Javascript - Beginner Practice

Javascript - Beginner Practice

12th Grade - Professional Development

55 Qs

Internal Exam Quiz

Internal Exam Quiz

University

47 Qs

CHAPTER 1: INTRODUCTION TO COMPUTERS

CHAPTER 1: INTRODUCTION TO COMPUTERS

University

45 Qs

it-Викторина

it-Викторина

University

48 Qs

Test 1 - JavaScript

Test 1 - JavaScript

Assessment

Quiz

Computers

University

Medium

Created by

Chadnie Ampalaya

Used 1+ times

FREE Resource

50 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A web developer wants to add interactivity to a webpage, such as making a button display an alert when clicked. Which programming language should they use?

HTML

CSS

JavaScript

SQL

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A company wants to create a dynamic website where users can interact with elements without reloading the page. What feature of JavaScript allows this?

Static Content Rendering

Client-Side Scripting

Relational Database Management

Cascading Style Sheets

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

An online store wants to display a pop-up message when a customer adds an item to their cart. Which JavaScript function can be used for this?

console.log("Item added!");

alert("Item added to cart!");

document.write("Item added!");

prompt("Item added to cart!");

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A developer wants to change the text of a paragraph when a user clicks a button. Which JavaScript method can they use?

document.getElementById("demo").innerHTML = "New text";

document.getElementById("demo").style.color = "red";

alert("New text");

console.log("New text");

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A business website wants to execute JavaScript code only when the webpage is fully loaded. Which event should be used?

onmouseover

onclick

onload

onkeydown

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A web developer wants to ensure that JavaScript is executed only after the HTML content is fully loaded. Where is the best place to place the <script> tag?

Inside the <head> section

At the beginning of the <body> section

At the end of the <body> section

Inside a <div> element

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A company wants to separate JavaScript code from their HTML file for better organization and reusability. What is the best approach?

Write JavaScript inside the <body> section

Use the <script> tag inside the <head> section

Place JavaScript in an external .js file and link it using <script src="script.js"></script>

Use inline JavaScript within HTML elements

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?