JavaScript for Developing Interactive Websites and Web Applications 1.1

This test covers the role of JavaScript in developing interactive websites and web applications, including both programming skills and management aspects in the IT field. It provides a comprehensive overview of core programming concepts and their application in modern web projects.

Sample Questions

  1. Which of the following is used to select an HTML element by its ID in JavaScript?

    • getElementById()
    • getElementByClass()
    • querySelectorAll()
    • getElementsByTagName()
  2. What is the correct way to declare a variable in JavaScript that cannot be reassigned?

    • var myVar = 5;
    • const myVar = 5;
    • let myVar = 5;
    • variable myVar = 5;
  3. Which method is used to add an event listener to an HTML element in JavaScript?

    • listenEvent()
    • onEvent()
    • addEventListener()
    • attachEvent()