JS Form Events

  • submit
  • reset
  • focus
  • blur
  • change
  • input
Qus. 1 : Which of the following events occurs when an HTML form is submitted?

  1. onchange
  2. onsubmit
  3. oninput
  4. onreset
Qus. 2 : What is the correct way to attach an event handler in JavaScript using addEventListener()?

  1. element.addEventListener("click", function);
  2. element.addEventHandler("click", function);
  3. element.attach("click", function);
  4. element.on("click", function);
Qus. 3 : What is the purpose of the focus event in JavaScript?

  1. It is triggered when an element is clicked
  2. It is triggered when an element gains focus
  3. It is triggered when an element is hovered
  4. It is triggered when the window is resized
Qus. 4 : Which event occurs when a user changes the content of an input field?

  1. oninput
  2. onchange
  3. onedit
  4. onupdate
Qus. 5 : What is the difference between the onblur and onfocus events in JavaScript?

  1. onblur fires when an element loses focus, and onfocus fires when an element gains focus
  2. Both events fire when the window is minimized
  3. Both events trigger when the page is loaded
  4. onblur fires when an element is clicked, and onfocus fires when the mouse moves over an element
Qus. 6 : Which event handler would you use to respond to an input field as the user is typing?

  1. onchange
  2. onkeydown
  3. oninput
  4. onkeypress

Programs

Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad