1
2
3
4
5
100

How do you include JavaScript in an HTML file?

By using the <script> tag.

100

What is the purpose of onclick in HTML?

 is an HTML attribute used to define JavaScript code to execute when an element is clicked.

100

What are some common arithmetic operations in programming?

 include addition (+), subtraction (-), multiplication (*), and division (/).

100

What is the purpose of the else statement in JavaScript?

The else statement provides an alternative set of instructions to be executed if the condition in the if statement is false.

100

How do you create a horizontal line in HTML?

By using the <hr> (horizontal rule) tag.

200

What does HTML stand for?

Hyper Text Markup Language

200

What does innerHTML do in JavaScript?

innerHTML is a property in JavaScript used to get or set the HTML content of an element.

200

What is the return statement used for in a function?

The return statement specifies the value to be returned by the function after its execution.

200

How can we define and initialize a variable in JavaScript?

let / var can be used to define a variable, let counter = 0, to initialize.

200

How do you create a heading in HTML?

By using the <h1> to <h6> tags for different levels of headings.

300

How do you access an element in the HTML document using its ID in JavaScript?

By using document.getElementById('id').

300

Name some basic data types in JavaScript.

 Numbers, Strings, Booleans, Null, Undefined, Objects, Symbols (ES6).

300

How do you create a function with a counter in JavaScript?

By using a global variable as a counter and updating its value within the function each time it's called.

300

How do you declare and initialize an array in JavaScript?

const myArray = [item1, item2, item3];

300

How do you create a numbered list in HTML?

By using the <ol> (ordered list) tag with <li> (list item) tags.

400

What does document.write do in JavaScript?

to write content directly to the HTML document.

400

What is the purpose of a conditional statement in programming?

allows the program to make decisions based on specified conditions.

400

How do you create a bullet list in HTML?

 By using the <ul> (unordered list) tag with <li> (list item) tags.

400

What is a function in programming?

a block of code that performs a specific task and can be reused multiple times.

400

How do you change the background color of an HTML element using JavaScript?

style.backgroundColor

500

What do style.fontSize and style.display control in JavaScript?

style.fontSize controls the font size of an element, and style.display controls whether an element is displayed or hidden.

500

What are the basic types of conditional statements in JavaScript?

The basic types are if, else if, and else.

500

What is the purpose of the <input> tag in HTML?

The <input> tag is used to create input fields for forms, such as text fields, buttons, checkboxes

500

How do you define a function in JavaScript?

By using the function keyword followed by a name

500

How do you hide an HTML element using JavaScript?

By setting the element's style.display property to "none"